[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Pulp-list] Date and Time Feedback Requested!



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/15/2011 03:15 PM, Jason L Connor wrote:
> On Fri, 2011-04-15 at 11:15 -0700, Mike McCune wrote:
>> On 04/15/2011 10:36 AM, Jason L Connor wrote:
>>> Hi Everyone,
>>>
>>> I'm personally struggling with date and time formats and timezone data
>>> in pulp.
>>>
>>> We're currently using 2 different formats, 1 for specifying date and
>>> time information and 1 for reporting date and time information. I'd like
>>> to see us unify this, and I'm looking for feedback on what is
>>> easiest/most desired.
>>>
>>> For reporting, we're generally using a timestamp as seconds since the
>>> epoch as a float in the utc timezone.
>>>
>>> For specifying date time data, we're accepting objects with the
>>> following integer fields: (year, month, day, hour, minute) in the local
>>> timezone of the pulp server.
>>>
>>>
>>> This is obviously confusing... (especially because some of the reporting
>>> is using the second format, like for repo schedules)
>>>
>>>
>>> Here's what I'd like to propose:
>>>
>>> The date/time format is always an object, with the fields(year, month,
>>> day, hour, minute, second)
>>> Please note that pulp will not honor the 'second' field when specify
>>> times, it's only use is in reporting.
>>>
>>> The times are always specified in the timezone local to the pulp server.
>>>
>>> This keeps the logic on pulp as simple as possible. As well as providing
>>> both a machine parsable and human readable format for date/time data.
>>>
>>> Ok, fire away...
>>
>> I'm not sure from your email what this really means from a Database, 
>> REST-API and CLI impact.
>>
>> Are you saying that dates will no longer be stored as a timestamp and 
>> instead will be a custom object with YY/MM/DD mm:ss vs a timestamp and 
>> the API's JSON will now have this set of fields?
>>
>> {
>>    "scheduled_time": null,
>>    "exception": null,
>>    "status_path": 
>> "/pulp/api/repositories/test2/sync/a3020f94-678b-11e0-93fd-0019d1630404/",
>>    "finish_time": "1302891027",
>>    "start_time": "1302891025",
>> ...
>> }
>>
>> would now become:
>>
>>
>> {
>>    "scheduled_time": null,
>>    "exception": null,
>>    "status_path": 
>> "/pulp/api/repositories/test2/sync/a3020f94-678b-11e0-93fd-0019d1630404/",
>>    "finish_time": {
>>                     "day": "15",
>>                     "month": "Apr",
>>                     "year": "2011",
>>                     "hour": "11",
>>                     "minute": "10",
>>                     "second": "27"
>>                   },
>>    "start_time": {
>>                     "day": "15",
>>                     "month": "Apr",
>>                     "year": "2011",
>>                     "hour": "11",
>>                     "minute": "09",
>>                     "second": "14"
>>                   },
>> ...
>> }
>>
>> or something similar?
>>
>> My first reaction is I prefer timestamps since it is a standard format 
>> that all languages can parse and understand.  The complex object option 
>> requires custom code to be written for all callers of the API which is 
>> onerous, but I'll let you clarify before I go further...
>>
>> Mike
> 
> Yep, that's the gist of it.
> 
> I'm liking the objects because it's easier to specify date times in, as
> well as have some control over the granularity that pulp honors.
> 
> Objections, however, are welcome. I'm trying to get a feel for what to
> use here.
> 
> As far as timezone data, we can add the timezone as a string in the
> object.
> { 'year': 2011,
>   'month': 4,
>   'day': 15,
>   'hour': 13,
>   'minute': 14,
>   'second': 49,
>   'timezone': 'America/Denver'
> }

The other benefit to objects is readability. It's much easier to just
look at the value and know what's going on than having to find something
to translate an arbitrary float.

> 
> 
> _______________________________________________
> Pulp-list mailing list
> Pulp-list redhat com
> https://www.redhat.com/mailman/listinfo/pulp-list


- -- 
Jay Dobies
RHCE# 805008743336126
Freenode: jdob
http://pulpproject.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNqJmmAAoJEOMmcTqOSQHC46AH/AtaMBjARfx5yscZD5L9DYci
LEy2aV07Wl7B1lsBL22VYMe0FyspwYB0R0oyQ5WWDkOehZCwhBhLJJ7Z3ICopWuR
Q+pIgxDM4f/XutOdVafCXvIK8c0IvS8k16Hb0OaPwlOFzXd8qubQYVm2AXeOmJGI
5nC+Pwh6Rx/M09Y5sl8opTGpa9d2F0LhPYGj/PFqmGT0DuuFaJJEfDrkIcUjzT+0
rqrKNm5uGb3Qq1iFgYTTAIl6NMN9V7q3vzJYGMrYbZQ7pyvQfd0OgbdW7KYJzlwy
BA7fQrUDrdaz1RnoR6/sh9RiPJ5nfQX4LKNCSw2FTUJK/Z2GbGvzO6NLFJfWV8s=
=olGG
-----END PGP SIGNATURE-----


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]