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

  • Home
  • SEARCH
  • 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 8534133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:07:27+00:00 2026-06-11T10:07:27+00:00

I wanted to convert a date (nsdate) to tick values. Tick values are (1

  • 0

I wanted to convert a date (nsdate) to tick values. Tick values are (1 Tick = 0.1 microseconds or 0.0001 milliseconds) since 1 Jan 0001 00:00:00 GMT. NSDate has functions like timeIntervalSince1970. So, how do I convert it?

  • 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-11T10:07:28+00:00Added an answer on June 11, 2026 at 10:07 am

    I would like to share my experience:

    I tried to find the seconds from 01/01/0001 and then multiply by 10,000,000. However, it gave me wrong results. So, I found out that 01/01/1970 is 621355968000000000 ticks from 01/01/0001 and used the following formula along with timeIntervalSince1970 function of NSDate.

    Ticks = (MilliSeconds * 10000) + 621355968000000000

    MilliSeconds = (Ticks – 621355968000000000) / 10000

    Here is the outcome:

    +(NSString *) dateToTicks:(NSDate *) date
    {
        NSString *conversionDateStr = [self dateToYYYYMMDDString:date];
        NSDate *conversionDate = [self stringYYYYMMDDToDate:conversionDateStr];
        NSLog(@"%@",[date description]);
        NSLog(@"%@",[conversionDate description]);
        double tickFactor = 10000000;
        double timeSince1970 = [conversionDate timeIntervalSince1970];
        double doubleValue = (timeSince1970 * tickFactor ) + 621355968000000000;
        NSNumberFormatter *numberFormatter = [[[NSNumberFormatter alloc] init] autorelease];
        [numberFormatter setNumberStyle:NSNumberFormatterNoStyle];
        NSNumber *nsNumber = [NSNumber numberWithDouble:doubleValue];
        return [numberFormatter stringFromNumber:nsNumber];
    }
    

    Likewise, to convert from tick to date:

    //MilliSeconds = (Ticks - 621355968000000000) / 10000
    +(NSDate *) ticksToDate:(NSString *) ticks
    {
        double tickFactor = 10000000;
        double ticksDoubleValue = [ticks doubleValue];
        double seconds = ((ticksDoubleValue - 621355968000000000)/ tickFactor);
        NSDate *returnDate = [NSDate dateWithTimeIntervalSince1970:seconds];
        NSLog(@"%@",[returnDate description]);
        return returnDate;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wanted to convert DateTime data which will be pulled from source, to Date
I wanted to convert some xml to a magazine like pdf document. A lot
I wanted to know if there's a javascript library which can convert timestamp (Date
I have the following date string: dtstr = '2010-12-19 03:44:34.778000' I wanted to convert
I wanted to convert string of EditText to Bitmap. have a string like this
I wanted to convert from rgb to hsv but the results seem to be
How can I convert ASN1_TIME to time_t format? I wanted to convert the return
I wanted code to convert all the characters in strings to uppercase or lowercase
I wanted to convert a 700MB table from MyISAM to InnoDB with the following
i wanted to convert double to float in C, but wanted to preserve the

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.