Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Format getTickCount()

    Is it possible to format an integer representing seconds into a viewable date? I would like to be able to store dates as seconds integers for easier calculations, but can't seem to get ColdFusion to convert them back to viewable dates.

    dateFormat(getTickCount(), "m/d/y") just shows up blank...

  • #2
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok, I did a bit of testing and it appears that the number being returned by getTickCount is just too long. If I remove a couple digits, a date finally shows up. Is there any way to get the dateFormat() function to parse recent dates from seconds?

  • #3
    Regular Coder
    Join Date
    Jul 2002
    Location
    Las Vegas, NV - USA
    Posts
    104
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What's the problem using the GetDate() function instead of GetTickCount()? The problem you are going to have is that if GetTickCount() is using the native Windows GetTickCount() call (which I think it does), the tick count is a 32 bit word value that starts at zero when the computer is booted. Also, it has limited range that rolls over at about 26 days.

    If you only need resolution down to the second, I would rethink the solution using the GetDate() value.
    Steven Sommers (blog)
    Shift4 Corporation -- www.shift4.com

    Creators of $$$ ON THE NET(tm) payment processing services.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •