'How to correctly handle Timestamps and Timezones in AWS's Timestream?

I have a timestamp field that carries a timezone offset, which I'm trying to insert into Timestream but it's adding 9 zeroes at the end, like the example beneath:

2022-05-05 04:19:16.000000000

Those zeroes are not the timezone I've set (as the example beneath) but, instead, I believe it's using the server's timezone.

date_default_timezone_set('Europe/Copenhagen');
$time = strval(time() * 1000);

This is how I'm passing the Timestamp to Timestream:

...
'MeasureValues' => [
  [
    'Type' => 'TIMESTAMP',
    'Name' => 'created_date',
    'Value' => $time,
  ],
],
...

And, finally, why it ONLY accepts time in milliseconds? Why I cant just insert an actual date time format?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source