Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

timestamp

Status
Not open for further replies.

fluppe689

Programmer
Jul 11, 2008
75
BE
Hello Experts

Does someone knows how to convert a date to a timestamp


Wfg,

Filip

 
Try this.

SET HOURS TO 12
? DTOT(DATE()) && Displays 06/18/2013 12:00:00 AM

Irwin
 
How about that?

thread184-1667022

And the inverse simply is DATETIME()-DATETIME(1970, 1, 1, 0, 0, 0)

Only having a date (D) instead of a datetime (T) you simply turn the date into a datetime first via DTOT, as Irwin suggests, so DTOT(DATE())-DATETIME(1970, 1, 1, 0, 0, 0) gives you the unixt timstamp of today, 0 am midnight.

And as said in the other thread, that doesn't account for time zones, a unix timestamp is not bound to GMT, for example, as you can see here: which displays DST and GMT unix timestamp.

Bye, Olaf.
 
Sorry, I meant EST and UTC or GMT, not DST. DST stands for daylight savings time, not a time zone identifier.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top