• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 387
  • Last Modified:

Unix Time stamps

Hello,

Does anyone have a coldfusion script to convert a normal date/time ie: now() into a unix timestamp.

Many Thanks
0
doggybs
Asked:
doggybs
  • 2
  • 2
1 Solution
 
mkishlineCommented:
<cfset unixtimestamp = DateDiff("s",CreateDate(1970,1,1),Now()) />
0
 
doggybsAuthor Commented:
Spot on! cheers mkishine.
0
 
doggybsAuthor Commented:
Do you have any ideas on getting the time stamp in milliseconds?

Thanks
0
 
mkishlineCommented:
Coldfusion doesn't have any functions that determine time stamps with that degree of accuracy, so your best bet would be to ballpark the value by multiplying your timestamp by 1000.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now