How to get timestamp since epoch in Windows?

7,527

You may not like this ...

Load cygwin onto your PC (www.cygwin.org)
create a script that executes commands
date +%s.%N
your_applicaiton
date +%s.%N
Open a bash shell
Run the script

Get output like
1369457045.186880000
1369457053.766895000

Share:
7,527

Related videos on Youtube

Eduard Florinescu
Author by

Eduard Florinescu

Coding my way out of boredom. “If the fool would persist in his folly he would become wise.” (William Blake)

Updated on September 18, 2022

Comments

  • Eduard Florinescu
    Eduard Florinescu over 1 year

    I want to measure the time of start for a program but for this I want to get the timestamp in Windows, but I need to get the time-stamp in mili-seconds since the Unix epoch format. (The Unix epoch is the time 00:00:00 UTC on 1 January 1970 (or 1970-01-01T00:00:00Z ISO 8601).)

    How can I get timestamp in milseconds since Unix epoch through a Windows command?

    • Richard
      Richard about 11 years
      Have you looked at this question? stackoverflow.com/questions/3454112/…
    • Eduard Florinescu
      Eduard Florinescu about 11 years
      @Richard No, but I looked now and 1) first answer is in seconds. 2) second answer is not so clear. 3) seems to be about epoch in general not Unix epoch. 4) I need something to get the time stamp without getting too much overhead and I don't know how much it takes to run cscript.