Skip to main content

GMT time change in Handlebar

Comments

4 comments

  • Official comment
    Dan Claypool NetSuite Integration Whiz Strategic Support Lead
    Celigo University Level 4: Legendary

    Hi Paul,

    With "dateFormat", you can specify the timezone you'd like the UTC/Zulu date/timestamp you'd like it to be converted to:

    {{dateFormat "YYYYMMDDHHmmss" lastExportDateTime "" "US/Eastern"}}

    For your example, the expression would be the following:

    /Transaction/findTransactionsByPeriodAndParametersExt?startDate={{dateFormat 'YYYYMMDD' date}}&endDate={{dateFormat 'YYYYMMDD' date}}&startTime={{dateFormat "YYYYMMDDHHmmss" lastExportDateTime "" "US/Eastern"}}&getFunctions=false

    This should evaluate like so:

    Best Regards,

    Dan

  • PaulS
    Celigo University Level 1: Skilled
    Awesome Follow-up
    Engaged

    Something like this: /Transaction/findTransactionsByPeriodAndParametersExt?startDate={{dateFormat 'YYYYMMDD' date}}&endDate={{dateFormat 'YYYYMMDD' date}}&startTime={{substring (subtract 18000000     (dateFormat "YYYYMMDDhhmmss" lastExportDateTime)) "8" "14"}}&getFunctions=false

    But the "substring"  doesn't like the way I have nested the hour subtraction (in ms) and is expecting a string...

    0
  • Kate Larson Community moderator Principal Technical Writer
    Celigo University Level 3: Master

    Hi PaulS - Thanks for posting to the Community, and sorry you haven't received any responses yet. I'm working on getting some eyes on your question internally. If you made progress on this in the meantime, please post an update. 

    -Kate

    0
  • Scott Henderson CTO
    Answer Pro
    Top Contributor

    I was working on a response in parallel, but Dan beat me to the post!  All I can add now is that you need to use the correct timezone values in all your dateFormat functions, and you probably want to use 'lastExportDateTime' and 'currentExportDateTime' instead of 'date'.

    Here is my best guess for the relative URI you are trying to build.

    /Transaction/findTransactionsByPeriodAndParametersExt?startDate={{dateFormat 'YYYYMMDD' lastExportDateTime '' 'US/Eastern'}}&endDate={{dateFormat 'YYYYMMDD' currentExportDateTime '' 'US/Eastern'}}&startTime={{dateFormat 'HHmmss' lastExportDateTime '' 'US/Eastern'}}&endTime={{dateFormat 'HHmmss' currentExportDateTime '' 'US/Eastern'}}&getFunctions=false
    0

Please sign in to leave a comment.