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 6811215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:17:59+00:00 2026-05-26T20:17:59+00:00

I am trying to duplicate the functionality that is currently implemented in VB. What

  • 0

I am trying to duplicate the functionality that is currently implemented in VB. What I need to do is convert a date to a long integer and then convert that to a string. I also need to convert a long integer into a HEX value of that integer and then that to a string.

Here is the code I am using in VB.

If dteCreated <> #12:00:00 AM# Then
strHash = CStr(CLng(dteCreated))

If InStr(1, strHash, ".", vbTextCompare) > 0 Then
    strHash = Left(strHash, InStr(1, strHash, ".", 1) - 1) & "_" & Mid(strHash, InStr(1, strHash, ".", 1) + 1)
Else
    strHash = strHash & "_00000"
End If

strHash = strHash & "_" & CStr(Hex(intereq))

The two variables are dteCreated (Date) and intereq (Long). What this builds is a hashed query string that is decoded on our server.

Can anyone help with the methods I would need to use in Objective-C to get this same functionality?

  • 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-05-26T20:18:00+00:00Added an answer on May 26, 2026 at 8:18 pm

    You can use a reference since 1970 to convert to a NSTimeInterval which is a double, use:

    - (NSTimeInterval)timeIntervalSince1970
    + (id)dateWithTimeIntervalSince1970:(NSTimeInterval)seconds
    

    You can convert the double to an int and back with casting loosing only the fractions of a second.

    Example:

    NSDate *today = [NSDate date];
    NSLog(@"today %@", today);
    
    NSTimeInterval interval = [today timeIntervalSince1970];
    NSString *hexInterval = [NSString stringWithFormat:@"%08x", (int)interval];
    NSLog(@"hexInterval %@", hexInterval);
    
    unsigned intInterval;
    NSScanner *scanner = [NSScanner scannerWithString:hexInterval];
    [scanner scanHexInt:&intInterval];
    
    NSDate *date = [NSDate dateWithTimeIntervalSince1970:interval];
    NSLog(@"date  %@", date);
    

    NSLog output:

    today 2011-11-15 18:34:07 +0000
    hexInterval 4ec2acf0
    date  2011-11-15 18:34:07 +0000
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to find duplicate keys so that they can be addressed and made
So I'm working with authlogic, and I'm trying to duplicate the login functionality to
I'm using jquery 1.3 and is trying to duplicate the 1.4 .has functionality. I
I am trying to duplicate a row in my table, into another table. There
I am trying to duplicate a text report that was written in Icon in
I am trying to duplicate the site notice banner that is displayed on the
Possible Duplicate: How to embed WebKit into my C/C++/Win32 application? I am trying to
I'm trying to duplicate the Overflow Menu dropdown functionality for other ActionBar items. I'm
I am trying to duplicate my C# string formatting where i can do something
I am trying to prevent duplicate entries into my sqlite db by using 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.