Go Back   CodingForums.com > :: Server side development > Other server side languages/ issues > ColdFusion

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-09-2007, 09:12 PM   PM User | #1
jfredrickson
New to the CF scene

 
Join Date: Jul 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
jfredrickson is an unknown quantity at this point
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...
jfredrickson is offline   Reply With Quote
Old 07-09-2007, 09:15 PM   PM User | #2
jfredrickson
New to the CF scene

 
Join Date: Jul 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
jfredrickson is an unknown quantity at this point
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?
jfredrickson is offline   Reply With Quote
Old 09-05-2007, 05:11 PM   PM User | #3
Shift4Sms
Regular Coder

 
Join Date: Jul 2002
Location: Las Vegas, NV - USA
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts
Shift4Sms is an unknown quantity at this point
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.
Shift4Sms is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:03 AM.


Advertisement
Log in to turn off these ads.