Select to view content in your preferred language

Date Time field returns string that is too long

376
1
Jump to solution
08-08-2023 07:50 AM
MFazio
by
New Contributor III

I am using a date time field to help make a call to the Open Weather Maps API. However, the UNIX time string that gets returned from the date question is 13 characters long, and the API only wants it to be 10 characters long as to not throw an error. Is there a way to limit the Date Time to only return a 10 character string?

Example of default string length:

MFazio_0-1691506084045.png


API Response from 13 character UNIX Time string (as pictured above):

MFazio_1-1691506116533.png

 

API response after removing 3 trailing zeros:

MFazio_2-1691506163123.png

 

Thank you,

Mike F.

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
MFazio
by
New Contributor III

So after writing out this post, I inspired myself and was able to solve the issue using the function:

substr(${Sample_Date}, 0, 10)

View solution in original post

1 Reply
MFazio
by
New Contributor III

So after writing out this post, I inspired myself and was able to solve the issue using the function:

substr(${Sample_Date}, 0, 10)