Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Convert UNIX timestamp to Date/Time string


mcginwil_17 Sep 9, 2025 04:40 PM

Looking for information about converting between time formats. 

I am writing code for a CR350 WiFi logger that retrieves data from CampbellCloud via API calls. The return from Campbell cloud is a strring that includes a value and the timestamp, formatted as UNIX (milliseconds sin 01/01/1970). 

It would be useful for me to convert the UNIX timestamp to a string with the time formatted as Month/Day/Year hh:mm:sec

Are there any examples of CRbasic code to do this? The commands SecsSince1990 converts date/time as string to something that can be converted to UNIX, so is there any way to reverse this command to retrieve date/time as string from SS1990? 


JDavis Sep 9, 2025 10:06 PM

Yes, SecsSince1990() can be used in reverse. It picks the mode based on if the source variable is of type string or of type Long.

Log in or register to post/reply in the forum.