[Closed] how get year month day hour minute second
how get year month day hour minute second
begin i try filterstring localtime
now i find bug because operating system setting differ get result another too
my computer get style “2006-1-24 13:00:09”
helpfile is “4/14/97 10:24:57 AM”
You could use the [Avguard MAXScript Extensions]( http://www.maxplugins.de/r7_files/avguard/avg_dlx70_9.zip ) by Larry Minton. I has a getLocalTime() and getUniversalTime() function which returns the time as an array rather than a formatted string.
Cheers,
Martijn
try this (easier)
str=filterstring localtime “- :/”
year=str[1] as integer
Month=str[2] as integer
Day=str[3] as integer
Hour=str[4] as integer
Minutes=str[5] as integer
Seconds=str[6] as integer
you advert this localtime format
“4/14/97 10:24:57 AM”
this get str[1] is error,
str[3] year
That’s why I recommended the Avguard MAXScript Extensions. Simply copy the plugin to your plugins folder and read the included textfile. The two (local/universal) time functions don’t rely on your regional settings which make it much more reliable.
The only disadvantage is that the end user of your script will need to have the plugin installed as well…
- Martijn
I hope Larry gets these functions moved into the next Max version…they are sorely lacking in Maxscript. The existing time function is basically useless.