[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] convert from 'date +"%H-%M %m-%d-%Y"' to seconds from 1970


Il 05/05/20 11:29, Arne Babenhauserheide ha scritto:
Beyer, Christoph <christoph.beyer@xxxxxxx> writes:
maybe a stupid question, is there a way to translate a `date +"%H-%M %m-%d-%Y"` (or similar) into a HTC usable 'seconds-since-1970' maybe using time() or formatTime() inside a classadd string ?

I know formatTime() works the other way round but I would like to do some START calculation based on a date given by the user which would be more conveniant to be in 'human readable' format ...
Hereâs a long form:

guile -c '(import (srfi srfi-19))(display (date->string (string->date "18-06 05-24-1983" "~H-~M ~m-~d-~Y") "~s\n"))'

Iâm sure thereâs a shorter shell-command, but I donât have it at hand
right now.

Maybe this one?

~$ date --date "2020-04-25 12:30" +%s


Best wishes,