Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a date field called 'created_at' that comes into my application in the following format:
Mon Aug 26 14:04:21 +000 2019
How can I transform this in the script to show as a date in the format MM/DD/YYYY (from example above 8/26/2019
instead of 'Mon Aug 26 14:04:21 +000 2019' place created_at
=Date(Date#(SubField(created_at,' ',2)&'-'&SubField(created_at,' ',3)
&'-'&SubField(created_at,' ',6),'MMM-DD-YYYY')
,'MM/DD/YYYY')
Where do I place my current field of 'created_at'
instead of 'Mon Aug 26 14:04:21 +000 2019' place created_at
=Date(Date#(SubField(created_at,' ',2)&'-'&SubField(created_at,' ',3)
&'-'&SubField(created_at,' ',6),'MMM-DD-YYYY')
,'MM/DD/YYYY')
Replace 'Mon Aug 26 14:04:21 +000 2019' in @dplr-rn solution above with [created_at] like this
Date(Date#(SubField([created_at], ' ',2)&'-'&SubField([created_at] ,' ',3)
&'-'&SubField( [created_at], ' ',6),'MMM-DD-YYYY')
,'MM/DD/YYYY') as [Created at]
Thank you for your input. A follow-up question, would be if I wanted to get the Day of Week and Month from that field and create new fields called Day and Month, how would I do that in the script?
You would use Day and Month function
Day(Datefield) as Day,
Month(Datefield) as Month,