Forum Discussion

Mackinaw's avatar
14 years ago

GMT date/time adjustment

Hello,

I'm using the following code to enter the current date and time into a freemarker page:

<#assign timeStamp = datesupport.now />

${timeStamp.getDateAsString()} ${timeStamp.timeAsString}

 

Is there a good way to adjust that to GMT time (short of just adding daylight savings logic and then adding 7 or 8)?

 

Thank you,

Paul

1 Reply

  • HaidongG's avatar
    HaidongG
    Lithium Alumni (Retired)
    13 years ago

    Hi Paul,

     

    I know that this is a topic almost 1 yr and 3 months old. and you may already have your solution to it. but just for the benfit of other people, I am sharing my solution to adjust the server time to the customer time.

     

    ${.now?iso("Australia/Sydney")?datetime("yyyy-MM-dd'T'HH:mm:ss")?string("EEE dd MMM yyyy hh:mm:ss aa")}