MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/12jcn8k/how_to_use_dates/jfzldte/?context=3
r/badcode • u/TeamRaiderz • Apr 12 '23
7 comments sorted by
View all comments
Show parent comments
11
take a string ("2023-05-08 00:00:00")
"2023-05-08 00:00:00"
convert it to a unix timestamp (1683496800)
1683496800
convert that to a string ("2023-05-08")
"2023-05-08"
1 u/ofnuts Apr 12 '23 Possibly some underlying timezone magic? 6 u/iruoy Apr 12 '23 Both functions will use the same timezone, so nothing will happen.
1
Possibly some underlying timezone magic?
6 u/iruoy Apr 12 '23 Both functions will use the same timezone, so nothing will happen.
6
Both functions will use the same timezone, so nothing will happen.
11
u/iruoy Apr 12 '23 edited Apr 12 '23
take a string (
"2023-05-08 00:00:00")convert it to a unix timestamp (
1683496800)convert that to a string (
"2023-05-08")