0

"Now" as Date parameter in data source queries

Hi
We have a data source queries, where we want to pass a timestamp for "right now" in my timezone down to precision of seconds (more precise would be fine). The following query does what we want, but seems needlesly complicated:

endpoint?now={date.tz("CET" ).today.format("yyyy-MM-dd'T'HH:mm:ss")}

Desired result: now=2022-02-08T07:42:42

Is there a shorter and easiert to maintain way to achive a similar result?

Best Regards

3 comments

  • Avatar
    Shima Beigzadeh Official comment

    Hello there, 

    Thanks for posting in our community post! 

    In one way, if you like to make the query simpler, you can bring data for Today using {date.today()} then in Klip editor/ properties panel tab, set your column Date to be:
    - Format as: Date/Time,
    - Display format to yyyy-MM-dd'T'HH:mm:ss
    - Set the TimeZone: CET (If your account locale setting is in CET, you would only click on "Use default time zone"

    Hope this helps!

    If you have any further questions or require support for this, please feel free to reach out to support@klipfolio.com with our team and we'd be happy to help further!

    Shima

  • 0
    Avatar
    Eventfrog Billing

    Hi Shima

    Thank you for your answer.

    Your suggestion would be helpfull for displaying that date in a Klip. However, for us it is relevant, that we call an API with a timestamp that does not only indicate todays date but also the hours, minutes and seconds (milliseconds would work, but are not required).

    Best Regards

  • 0
    Avatar
    Shima Beigzadeh

    Hello, 

    There isn't a shortcut to use for date parameter in query at this time.
    However, if the formula for date works and get what you are looking for, then that is great, if not, please reach out to support@klipfolio.com and we can look closer into your API and your case to see if there is an alternative solution. 

    Shima

Please sign in to leave a comment.