Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8804655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:39:43+00:00 2026-06-14T01:39:43+00:00

I am using core data in my project. Database is sqlite and there is

  • 0

I am using core data in my project. Database is sqlite and there is column for storing “birthdate” having datatype “timestamp”.

Now, I want to insert some records in it and I am having dates in human readable format like “1809-06-17”.

How to convert this date to timestamp so that, I get this date when fetched from database.

I tried some conversions using python script, but I got different results.

Is there any easy way to do this? Please help me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T01:39:44+00:00Added an answer on June 14, 2026 at 1:39 am

    You could store the date as TEXT and dont have to worry about converting to and from timestamp.

    To convert timestamp to NSDate use:

    NSDate *date = [NSDate dateWithTimeIntervalSince1970:timeStamp];
    NSLog(@"%@", date);
    

    String to NSDate to timestamp:

    NSDate *date = [NSDate dateWithString:stringWithDate];
    NSTimeInterval timeStamp = [date timeIntervalSince1970];
    

    SQLite doesnt have a datatype for Date, it just stores it in a INT (Unix Time), REAL(Julian day numbers) or TEXT(ISO8601 strings) depending on what you choose.

    So you could just store the date in the format you already have (“1809-06-17”) as a TEXT column or you store as a timestamp in an INT column using the methods above to convert both ways.

    SQLite Date and Time functions: SQLite date and time
    SQLite DATATYPES: SQLite datatypes doc
    SQLite Oficial Site and Documentation: SQLite Home

    Hope you can solve your problem

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created an iPhone project using the Core Data template. Now when I try
I'm using Core Data to persist some information in a SQLite database. I'm testing
I am using core data to store objects for my project.There is a date
When creating a new project (universal iPhone/iPad) using Core Data, there's the usual appDelegate
I'm currently having the following issue in my project: I'm using Core Data to
I am using Core Data and want a Text Label to display how many
My iPhone application uses Core Data and a SQLite database; versions are being tracked
I'm using Core data in an iOS project. I have the data model setup
I am using Apple's CoreDataBooks sample project as a learning aid for core data.
I'm using Core Data to store a project name and display it in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.