Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I need to convert the timestamp 'Apr 21 2015 3:45:33:000PM' to the date format '4/21/2015' .
Kindly help me to achieve the same.
Thanks in adavnce for your help.
Regards,
Krishnan G
Try: Date(Date#(Left('Apr 21 2015 3:45:33:000PM',12),'MMM DD YYYY'),'M/D/YYYY')
Note, there are two spaces between the month Apr and the day 21. These two spaces need to be in the date format string of the Date# function too.
Date(floor(Date#('Apr 21 2015 3:45:33:000PM', 'MMM DD YYYY h:mm:ss:ffftt')), 'M/D/YYYY')
floor to remove the time part
Even this might be helpful if there are inconsistent spaces in your timestamp field:
=Date(Date#(Left(PurgeChar('Apr 21 2015 3:45:33:000PM', ' '), 9), 'MMMDDYYYY'))
here you can replace the manual entry with your date timestamp field in the script:
Date(Date#(Left(PurgeChar(TimeStampField, ' '), 9), 'MMMDDYYYY')) as Date