How to format epoch date into month day year?

3807
16
Jump to solution
07-08-2016 05:41 PM
Joseph_Kinyon
Occasional Contributor II

My concatenation using this formula is working correctly:

concat(${observer}, "-",${species},"-",${date},"-",${time})

However the time in epoch format is not friendly to quick review.

What formulas or formatting can I use inside this formula to return the epoch value stored in {time} to display in a text box as  "YYYY-MM-DD - H:m:s" -- including any corrections for time zone and or origin in 1970?

0 Kudos
1 Solution

Accepted Solutions
NathanEnge
Esri Contributor

Voila Merci. Upgrade to 1.10 was the resolution.

View solution in original post

16 Replies
Joseph_Kinyon
Occasional Contributor II

Anyone seen a formatting instruction formula for displaying time or date data as year, month, day using the value stored in a previous answer?

0 Kudos
IsmaelChivite
Esri Notable Contributor

Did you try this?

  date(${dateQuestion})

Joseph_Kinyon
Occasional Contributor II

Thanks Ismael, part of the direction I needed!

The function

     date(${dateQuestion})

also returns the time, but when using the date picker the time is set at 00:00:00 and displays it with the date, so I tried this:

     date(${obstime})

The observation time ${obstime} is filled using the time picker and returns a date and time formatted like this (below) which will be suitable for my needs for now:
     Tue Jul 19 08:46:25 2016 GMT-0700

This formula for my instance name now works as follows:

     concat(${observer},"-",${species},"-",date(${obstime})

However, not sure how to force the format-date function to work or if it is supported in Survey 123.

This calculation

     format-date(${obstime}, '%Y/%n/%e %H:%M:%S')

currently returns

     %Y/%n/%e %H:%M:%S

Joe

0 Kudos
NathanEnge
Esri Contributor

did you find an answer to this. i'm trying to format my date(${DATES}) with yyyy_mm_dd as part of a concat field...

but am having difficulty finding the correct syntax. Like you. I tried using format-date (

format-date(${DATES},'%n'))

but it the actual result shows up as '%n'

0 Kudos
IsmaelChivite
Esri Notable Contributor

Did you try this? format-date(${DATES},'%Y/%n/%e')  or this ? format-date(${DATES},'%Y_%n_%e')

0 Kudos
Joseph_Kinyon
Occasional Contributor II

Does the additional parentheses on the left make a difference? 

format-date((${DATES},'%Y/%n/%e')

Or should it be:

format-date(${DATES},'%Y/%n/%e')

0 Kudos
NathanEnge
Esri Contributor

the extra bracket on the left throws and error. I completed it with an end bracket. still no joy.

0 Kudos
NathanEnge
Esri Contributor

I tried: 

format-date(${DATES},'%Y/%n/%e')

and what I get in the survey:

0 Kudos
IsmaelChivite
Esri Notable Contributor

Attaching sample XLSFile with formatting expression. Nathan, can you please share you XLSFile?

0 Kudos