Coordinates model - Working draft.

Roy Williams roy at roe.ac.uk
Sat Jan 12 14:48:58 CET 2019


The time of LIGO-Virgo events is reported in ISO8601, like this:

"DATE-OBS": "2017-08-17T12:41:04.429237"

Python is pretty happy about ISO8601 (see below).



  *   Convert a datetime object to string in ISO 8601 format:

1
2

import datetime
datetime_str = some_datetime_obj.isoformat()


  *   Convert a ISO 8601 format string to datetime object:

1
2

import dateutil.parser
some_datetime_obj = dateutil.parser.parse(datetime_str)


---
Royal Observatory Edinburgh
roy at roe.ac.uk
07542 869986
________________________________
From: dm-bounces at ivoa.net [dm-bounces at ivoa.net] on behalf of Rob Seaman [seaman at lpl.arizona.edu]
Sent: 11 January 2019 7:53 PM
To: Steve Allen; Arnold Rots
Cc: Data Models mailing list
Subject: Re: Coordinates model - Working draft.


Does any out-of-the-box software handle ISO-8601 correctly? Generally one is well advised to forego the date/time routines in databases, for instance, and roll your own sexagesimal routines that know what to do with minus signs, etc.

Rob

--

On 1/10/19 4:19 PM, Steve Allen wrote:

On Thu 2019-01-10T17:52:20-0500 Arnold Rots hath writ:


Don't allow Z at the end of the ISO 8601 string.
It implies a time scale that may conflict with the time coordinate frame
specification.
It's nonsensical anyway since no one should use time zones.


True, but that still leaves a problem for software and humans.
It means that we have a string that looks like ISO 8601 but cannot be
parsed with out-of-the-box software that handles ISO 8601 because
without the Z that software assumes whatever is the default local time
zone of the process/machine.

That puts a cost and stumbling block on software and a need to state
prominently that as astronomers we cannot be confined within the
limitations of the ISO 8601 standard even though we are using just
something that looks like it.

--
Steve Allen                    <sla at ucolick.org><mailto:sla at ucolick.org>              WGS-84 (GPS)
UCO/Lick Observatory--ISB 260  Natural Sciences II, Room 165  Lat  +36.99855
1156 High Street               Voice: +1 831 459 3046         Lng -122.06015
Santa Cruz, CA 95064           https://www.ucolick.org/~sla/  Hgt +250 m



More information about the dm mailing list