Forum Discussion

james_scee's avatar
12 years ago

datesupport.millisecondsAsString?number returns time + 1 hour

Calling: 

.now 

and: 

datesupport.millisecondsAsString?number 

(which incidentally seems to be wrong here: 

http://lithosphere.lithium.com/t5/developers-knowledge-base/datesupport-FreeMarker-context-object/ta-p/9349 

datesupport. millisecondsAsString() appears to return a string, not a method

Both of these return a time one hour into the future, and I'd like to get the current time. How do I get the current timestamp? 

3 Replies

  • AdamN's avatar
    AdamN
    Khoros Oracle
    12 years ago

    nathan is right, these methods used as you've shown will give you the date/time in the timezone of the server. For example, you can actually see the timezone if you use the freemarker ?string.long directive:

    ${.now?string.long}

     If you want the date in UTC, you can use the ?iso_utc directive:

    ${.now?iso_utc}

     More details here:

    http://freemarker.org/docs/ref_builtins_date.html