#cetz plots with datetime ?

5 messages · Page 1 of 1 (latest)

civic wasp
#

Is it possible to create plots with cetz using datetime object in x axis ?
in other words: is it possible to convert datetime objects to float and float to datetime ?

pliant kite
#

I also want to know that. It would be nice if datetime would have a function to get a julian date-number.

supple hare
#

?r ```
#let a = datetime(
year: 2020,
month: 10,
day: 4,
hour: 18,
minute: 2,
second: 23,
)
#let unix-epoch = datetime(
year: 1970,
month: 1,
day: 1,
hour: 0,
minute: 0,
second: 0,
)

#let diff = (a - unix-epoch).seconds()

#diff

#let go_back = unix-epoch + duration(seconds: int(diff))

#go_back

supple hare
#

there you go