Unix time stamp to human readable date format

218 views
Skip to first unread message

Sunil Kumar

unread,
Jun 6, 2016, 8:25:32 PM6/6/16
to LoadRunner
How to convert unix time stamp to human readable date format? I want to convert time stamp like "1464632237607" into date format like "2016-05-30T18:17:17.607Z".

Rick Carter

unread,
Jun 7, 2016, 1:00:29 PM6/7/16
to LR-Loa...@googlegroups.com
Quick googling found this:


- Rick

--
Rick Carter
Application System Administrator Senior
Information Technology Services
University of Michigan
+1-734-647-5941
rkca...@umich.edu


On Jun 6, 2016, at 09:07, Sunil Kumar <suni...@gmail.com> wrote:

How to convert unix time stamp to human readable date format? I want to convert time stamp like "1464632237607" into date format like "2016-05-30T18:17:17.607Z".

--
You received this message because you are subscribed to the Google Groups "LoadRunner" group.
To unsubscribe from this group and stop receiving emails from it, send an email to LR-LoadRunne...@googlegroups.com.
To post to this group, send email to LR-Loa...@googlegroups.com.
Visit this group at https://groups.google.com/group/LR-LoadRunner.
To view this discussion on the web visit https://groups.google.com/d/msgid/LR-LoadRunner/661c149b-e73d-4dec-971c-1e335b33d032%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

André Luyer

unread,
Jun 8, 2016, 9:39:12 AM6/8/16
to LoadRunner
Note that a Unix time stamp has a resolution of one second. Your example is in milli seconds, so the first 10 digits represents the Unix time stamp.

Quick & dirty: use ctime:
long timestamp = 1464632237;
lr_log_message("%s", ctime(&timestamp));

To format the date&time in an other way lookup the strftime example in the online help.

André
Reply all
Reply to author
Forward
0 new messages