Expand my Community achievements bar.

Date/time code

Avatar

Former Community Member
Anyone know the simple code to display the date and time in the same field? What I mean is when the form would load it act as a timestamp,



12/12/2005 6:30pm.



Right now all I have is this:

$.rawValue = num2date(date(), DateFmt(1))



Which only displays the date.



Thanks
1 Reply

Avatar

Former Community Member
var today = new Date(); // JavaScript



When you access "today" it will return the full date as well as time and timezone. You could also create your own format using the methods of the Date() object:



.getDate()

.getMonth()

.getFullYear()

.getHours()

.getMinutes()