Hi,
Much of my software ends up spread around the world and I often need to know the UTC time on a machine; not the local time.
Internally PCs are UTC aware, would it be possible for:
Date() or Date(0) to return local time as it does now.
Date(1) to return UTC time.
Richard L
Date() optionally returning UTC time
- Rook Zimbabwe
- Addict
- Posts: 4322
- Joined: Tue Jan 02, 2007 8:16 pm
- Location: Cypress TX
- Contact:
After JAn 1 subtract 34 seconds from their clocks and use format date thussly:

Code: Select all
UTC$ = formatdate("%yyyy %mm %dd, %hhh %iim %sss", date()-34)

Erm, huh? Rook your confusing UTC with UT1 and TIA.
UTC is affected by leap seconds. (on systems that use network time correction like Windows, Mac and most Linux the time is corrected automatically).
As to RichardL's question, it's already been suggested but as a seperate function instead: http://www.purebasic.fr/english/viewtopic.php?t=23172
In the meantime (for those curious) this should get the job done:
http://www.purebasic.fr/english/viewtopic.php?t=35195
UTC is affected by leap seconds. (on systems that use network time correction like Windows, Mac and most Linux the time is corrected automatically).
As to RichardL's question, it's already been suggested but as a seperate function instead: http://www.purebasic.fr/english/viewtopic.php?t=23172
In the meantime (for those curious) this should get the job done:
http://www.purebasic.fr/english/viewtopic.php?t=35195