Latest News

the latest news from our team

Converting Unix Time to Other Formats

Some systems use a time stamp that is commonly referred to by one of the following names:

  • Unix time
  • Unit timestamp
  • POSIX time

The time is the number of milliseconds from 1 January 1970 12:00:00 UTC. For example, 1498683392 is the 28th of June, 2017, which is the date this post is authored.

To convert the value to a common format, create variables for the Unix time and the formatted value, and then use a Date Format procedure to convert it to the format you want to use:

  1. Create a variable and set it to the Unix time value. The example names this variable UnixTime.
  2. Create a second variable that you set in the procedure to the formatted time. The example names this variable MonthDayYear, because it uses that format.
  3. Create a procedure and use the variable that contains the Unix time:
  4. Add a Date Format action to the procedure. This example uses Long date format. Numerous formats are available.
  5. Add a Set Variable action and set the variable MonthDayYear.
  6. Verify the values in the Variables window.
  7. Save your changes.

Download the sample project, TimeSample.efz, to see a project that uses the procedure described in this post. Just unzip the file, start the eFORMz Composer, and open TimeSample.efz.

Leave a Reply

Your email address will not be published. Required fields are marked *