0
Community Beginner
,
/t5/coldfusion-discussions/unix-timestamp/td-p/379344
Apr 15, 2008
Apr 15, 2008
Copy link to clipboard
Copied
I'm looking for a way to convert a UNIX time value
(1201900638) so that it outputs to a ColdFusion page in the
mm/dd/yyyy format. Would anyone be able to help with that?
Thanks...
TOPICS
Getting started
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
Mentor
,
Apr 15, 2008
Apr 15, 2008
According to
Unix time
the number of seconds elapsed since midnight Coordinated
Universal Time (UTC) of January 1, 1970, not counting leap
seconds......The Unix time number is zero at the Unix epoch, and
increases by exactly 86 400 per day since the epoch
Therefore, 01-JAN-1970 + (1201900638 / 86400) = 01-FEB-2008
Is this the date that equates to the "UNIX time" number that you posted?
According to unix timestamp and epoch conversion tool, 1201900638 equates to the following:
GMT: Fri, 1...
Therefore, 01-JAN-1970 + (1201900638 / 86400) = 01-FEB-2008
Is this the date that equates to the "UNIX time" number that you posted?
According to unix timestamp and epoch conversion tool, 1201900638 equates to the following:
GMT: Fri, 1...
Mentor
,
LATEST
/t5/coldfusion-discussions/unix-timestamp/m-p/379345#M34248
Apr 15, 2008
Apr 15, 2008
Copy link to clipboard
Copied
According to
Unix time
the number of seconds elapsed since midnight Coordinated
Universal Time (UTC) of January 1, 1970, not counting leap
seconds......The Unix time number is zero at the Unix epoch, and
increases by exactly 86 400 per day since the epoch
Therefore, 01-JAN-1970 + (1201900638 / 86400) = 01-FEB-2008
Is this the date that equates to the "UNIX time" number that you posted?
According to unix timestamp and epoch conversion tool, 1201900638 equates to the following:
GMT: Fri, 1 Feb 2008 21:17:18 UTC
Your timezone (PDT): Friday, February 01, 2008 1:17:18 PM
Try this:
#DateConvert("utc2Local", DateAdd("s", 1201900638, CreateDate("1970","01","01")))#
Where CreateDate() converts January 01, 1970 to a date/time, DateAdd() with an "s" parameter adds 1201900638 seconds to the "epoch" start date, and DateConvert() with "utc2Local" converts the UTC time to your local time.
You can then use DateFormat() to display it in any format that you desire.
Phil
Therefore, 01-JAN-1970 + (1201900638 / 86400) = 01-FEB-2008
Is this the date that equates to the "UNIX time" number that you posted?
According to unix timestamp and epoch conversion tool, 1201900638 equates to the following:
GMT: Fri, 1 Feb 2008 21:17:18 UTC
Your timezone (PDT): Friday, February 01, 2008 1:17:18 PM
Try this:
#DateConvert("utc2Local", DateAdd("s", 1201900638, CreateDate("1970","01","01")))#
Where CreateDate() converts January 01, 1970 to a date/time, DateAdd() with an "s" parameter adds 1201900638 seconds to the "epoch" start date, and DateConvert() with "utc2Local" converts the UTC time to your local time.
You can then use DateFormat() to display it in any format that you desire.
Phil
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

