Unix Time stamps

Posted on 2006-04-10
Last Modified: 2013-12-24

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

Many Thanks
Question by:doggybs
    LVL 12

    Accepted Solution

    <cfset unixtimestamp = DateDiff("s",CreateDate(1970,1,1),Now()) />

    Author Comment

    Spot on! cheers mkishine.

    Author Comment

    Do you have any ideas on getting the time stamp in milliseconds?

    LVL 12

    Expert Comment

    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.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
    Now that Expression Web 4.0 ( is free if you buy or have the full version of Expression Web 3.0, now is the best time to  migrate from FrontPage to Expression Web (http://www.frontpage-to-exp…
    The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
    The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now