carrylex@lemmy.world to Programmer Humor@programming.dev · 4 months agoImplementing RFC 3339 shouldn't really be that hard...lemmy.worldimagemessage-square83fedilinkarrow-up1706arrow-down111file-text
arrow-up1695arrow-down1imageImplementing RFC 3339 shouldn't really be that hard...lemmy.worldcarrylex@lemmy.world to Programmer Humor@programming.dev · 4 months agomessage-square83fedilinkfile-text
minus-squarecarrylex@lemmy.worldOPlinkfedilinkarrow-up3·edit-24 months agoJust for further clarification, the API works like this: time is the local (client) time (in this case UTC-7) servertimezone is the time zone where the server is located timezoneoffset is the offset of the local time relative to the servertimezone (offset from the servers PoV) To get the UTC date you have to do something like this: time.minusHours(timezoneoffset).atZone(servertimezone).toUTC()
Just for further clarification, the API works like this:
time
is the local (client) time (in this case UTC-7)servertimezone
is the time zone where the server is locatedtimezoneoffset
is the offset of the local time relative to the servertimezone (offset from the servers PoV)To get the UTC date you have to do something like this:
time.minusHours(timezoneoffset).atZone(servertimezone).toUTC()