XML Feeds

.

[javascript-dev] Date object in Javascript

Joshua Kit Clayton jkc at musork.com
Wed Apr 23 10:07:42 MDT 2008


On Apr 23, 2008, at 7:40 AM, Ed Hamilton wrote:
>
> Hi, I ham having problems with the 'date' object in max due to the  
> spaces that it places between each character, i need to be able to  
> query date, and have that query returned as e.g 23/04/2008, I have  
> tried string concantation etc, but with no sucess, was wondering how  
> this could be acheived in javascript, I attempted using the  
> *_date.getSeconds(); etc, but due to limited experience, do not know  
> how to do this properly, any help would be much appreciated, many  
> thanks Ed


I'd suggest the simple max way--i.e. date->sprintf %.2d/%2.d/%d  
(example below). However for the Date reference, please see the  
javascript developer resources on mozilla.org. However, there is a bug  
with the JS Date object in Max 4.6 on MacTel which gives garbage  
results. This is fixed in Max 5.

-Joshua


#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 47 185 116 196617 sprintf %.2d/%2.d/%d;
#B color 5;
#P message 47 243 103 196617 04/23/2008;
#P newex 47 212 62 196617 prepend set;
#B color 5;
#P newex 47 156 36 196617 date;
#B color 5;
#P message 47 126 37 196617 date;
#P connect 4 0 2 0;
#P connect 1 0 4 0;
#P connect 2 0 3 0;
#P connect 0 0 1 0;
#P window clipboard copycount 5;



More information about the javascript-dev mailing list