[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

Hi Greg,

thanks a lot, and yes I can feel the dust in my lungs - cough-cough, unbelievable, it's time for a face mask literally everywhere nowadays ;) 

Should this work: 

cincoDeMayo = abstime("2020-05-05T10:30")

condor_status -startd <host> -af cincoDeMayo 

? (because I get undefined for now, probably missing something obvious here)


Christoph Beyer
DESY Hamburg

Notkestr. 85
Building 02b, Room 009
22607 Hamburg

mail: christoph.beyer@xxxxxxx

----- UrsprÃngliche Mail -----
Von: "gthain" <gthain@xxxxxxxxxxx>
An: "htcondor-users" <htcondor-users@xxxxxxxxxxx>
Gesendet: Dienstag, 5. Mai 2020 17:30:24
Betreff: Re: [HTCondor-users] convert from 'date +"%H-%M %m-%d-%Y"' to seconds from 1970

On 5/5/20 5:18 AM, Beyer, Christoph wrote:
> Hi,
> thanks, maybe my question was a bit misleading, I know there are a couple of ways to convert date formats into unix time and back.


This is one of the dusty corners of the classad language. The language 
has a separate type for Absolute and Relative time, called "abstime" and 
"reltime". You can create an absTime from a string using only one 
(sadly, united-states centric) format: YYYY-MM-DDTHH:MM"Â where T is a 
literal. So, in classads, could create an attribute with an absTime 
value like this:

cincoDeMayo = abstime("2020-05-05T10:30")

But, what you want is not the absTime type, which doesn't have many 
operations on it, but the more common Unix epoch format, seconds since 
Jan 1, 1970, or in this case (in my time zone), 1588692600. To do this 
in classads, you need to convert the absttime to an integer with a 
cast. So, try something like

CincoDeUnix = int(abstime("2020-05-05T10:30"))


HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting

The archives can be found at: