Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Werner95
Contributor
Contributor

Coverting Dates

Hi Qlickers

Im a trying to convert '6/13/2022 12:00:00 AM' to 'YYYY/MM/DD' but I cant seem to get it to work.

My script:

Date(Date#(Floor(AcuStock_Date),'D/M/YYYY hh:mm:ss TT'),'YYYY/MM/DD') as MyDate2

Please advise

Labels (1)
1 Solution

Accepted Solutions
Or
MVP
MVP

That formula isn't right...

Perhaps:

Date(Floor(Date#(AcuStock_Date,'M/D/YYYY hh:mm:ss TT')),'YYYY/MM/DD')

Your Date# format needs to match the string's format, which it doesn't appear to. You then need to Floor() that result (which will get rid of the timestamp aspect), and then the Date function on that will tag the field as date and set the format.

View solution in original post

3 Replies
Or
MVP
MVP

You can't floor a string, so that's likely your problem. Try moving the Floor outside the Date#.

Werner95
Contributor
Contributor
Author

Date(Floor(Date#(AcuStock_Date),'DD/MM/YYYY hh:mm:ss TT'),'YYYY/MM/DD') as MyDate2

no success

 

 

Or
MVP
MVP

That formula isn't right...

Perhaps:

Date(Floor(Date#(AcuStock_Date,'M/D/YYYY hh:mm:ss TT')),'YYYY/MM/DD')

Your Date# format needs to match the string's format, which it doesn't appear to. You then need to Floor() that result (which will get rid of the timestamp aspect), and then the Date function on that will tag the field as date and set the format.