0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-25 11:17:50 +01:00
posthog/hogvm/__tests__/date.hog

30 lines
664 B
Plaintext
Raw Normal View History

2024-07-15 12:58:32 +02:00
let dt := fromUnixTimestamp(1234334543)
print(dt)
print(toString(dt))
print(toInt(toUnixTimestamp(dt)))
print('-')
let dt2 := toDate('2024-05-03')
print(dt2)
print(toString(dt2))
print(toInt(toUnixTimestamp(dt2)))
print('-')
let dt3 := toDateTime('2024-05-03T12:34:56Z')
print(dt3)
print(toString(dt3))
print(toInt(toUnixTimestamp(dt3)))
print('------')
print(toTimeZone(dt3, 'Europe/Brussels'))
print(toString(toTimeZone(dt3, 'Europe/Brussels')))
print('-')
print(toTimeZone(dt3, 'Europe/Tallinn'))
print(toString(toTimeZone(dt3, 'Europe/Tallinn')))
print('-')
print(toTimeZone(dt3, 'America/New_York'))
print(toString(toTimeZone(dt3, 'America/New_York')))