View Full Version : How to get local / global time consistently
SyncViewS 10-29-2009, 10:31 AM Hi guys, I'm trying to retrieve local and global time but by reading this thread (http://forums.cgsociety.org/showthread.php?t=442144) I discovered that the maxscript function "localTime" is region dependent, so absolutely unreliable. The workaround seems to be to use "getFileCreateDate" on a dummy file created on purpose every time, but I'm not sure it could vary with different windows versions and date displaying settings.
Coming to the question, is there a way to get local and global time reliably and consistently? Maybe through dotNet?
Thank you.
- Enrico
|
|
Gravey
10-29-2009, 10:50 AM
use the getUniversalTime() function. found in the reference by typing "Local and Universal Time"
from the reference: Return the Local respectively the Coordinated Universal Time (UTC) as an 8 element array.
Array elements are:
1. Year - Specifies the current year.
2. Month - Specifies the current month; January = 1, February = 2, and so on.
3. DayOfWeek - Specifies the current day of the week; Sunday = 0, Monday = 1, and so on.
4. Day - Specifies the current day of the month.
5. Hour - Specifies the current hour.
6. Minute - Specifies the current minute.
7. Second - Specifies the current second.
8. Milliseconds - Specifies the current millisecond.
SyncViewS
10-29-2009, 11:09 AM
That's a bit embarrassing, I'm used to search in the reference, even the most hidden bit of information, but this one slipped so badly. Thank you very much!
- Enrico
CGTalk Moderation
10-29-2009, 11:09 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.