Skip to content

gitRigge/getTimestamp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

getTimestamp

Tests Coverage License: MIT Code style: Flake8

Get a UNIX timestamp on a Windows OS

Requirements

See requirements.txt

Getting Started

Run the following command to build the executable.

makeExe.bat

Or download the latest release from the GitHub repo release folder

Usage

Just run the executable in the Windows command line with date and time as paramter.

getTimestamp.exe "18.07.2019 12:53"

The output is then:

1563447180

Usage in batch file

The intention was to use the executable in a batch file like this:

SET timestamp=getTimestamp.exe
FOR /f "tokens=1-3 delims=." %%a in ('date /t') do (set mydate=%%a.%%b.%%c)
FOR /f "delims=" %%d in ('%timestamp% "%mydate%18:00"') do (set myts=%%d)

The variable %myts% holds then the current UNIX timestamp.

About

Get a UNIX timestamp on a Windows OS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published