PDA

View Full Version : how get year month day hour minute second


czweb
02-23-2006, 04:30 AM
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"

magicm
02-23-2006, 08:34 AM
You could use the Avguard MAXScript Extensions (http://www.maxplugins.de/max8.php?search=avguard) by Larry Minton. I has a getLocalTime() and getUniversalTime() function which returns the time as an array rather than a formatted string.

Cheers,
Martijn

czweb
02-23-2006, 10:18 AM
You could use the Avguard MAXScript Extensions (http://www.maxplugins.de/max8.php?search=avguard) by Larry Minton. I has a getLocalTime() and getUniversalTime() function which returns the time as an array rather than a formatted string.

Cheers,
Martijn

have sound code?
if i use this plugins edit scripts how to other people use?

czweb
02-23-2006, 10:39 AM
You could use the Avguard MAXScript Extensions (http://www.maxplugins.de/max8.php?search=avguard) by Larry Minton. I has a getLocalTime() and getUniversalTime() function which returns the time as an array rather than a formatted string.

Cheers,
Martijn
very good !
Know him to how attain of

Zbuffer
02-24-2006, 01:42 PM
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

czweb
02-25-2006, 02:27 AM
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

Zbuffer
02-25-2006, 07:15 PM
my computer get style "2006-1-24 13:00:09"

so year is n1 (str[1])

magicm
02-25-2006, 10:23 PM
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

JohnSwafford
02-27-2006, 01:18 AM
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.

CGTalk Moderation
02-27-2006, 01:18 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.