Helpful Information
 
 
Category: ColdFusion
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...

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?

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.










privacy (GDPR)