[Patches] [ python-Patches-452232 ] timestamp function for time module

noreply@sourceforge.net noreply@sourceforge.net
Tue, 01 Jan 2002 12:27:53 -0800


Patches item #452232, was opened at 2001-08-17 14:37
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=452232&group_id=5470

Category: Library (Lib)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Gareth Harris (garethharris)
Assigned to: Nobody/Anonymous (nobody)
Summary: timestamp function for time module

Initial Comment:
Timestamp creates timestamp strings 
in ISO or ODBC format in UTC or local timezones. 
It can also add microseconds where needed. 
Timestamps are often needed 
outside database or XML activities, 
so its proposed location is the time module.

timestamp(secs=None,fmt='ISO',TZ=None,fracsec=None):
    '''Make ISO or ODBC timestamp from [current] time.
    Parameters:
    secs= float seconds, else default = time()
    fmt = 'ISO' use ISO 8601 standard format = 
            "YYYY-MM-DDTHH:MM:SS.mmmmmmZ"       Zulu or
            "YYYY-MM-DDTHH:MM:SS.mmmmmm-hh:mm"  local
      else  "YYYY-MM-DD HH:MM:SS.mmmmmm"        ODBC
    TZ      = None=GMT/UTC/Zulu, else local time zone
    fracsec = None, else add microseconds to string
    '''

Any improvement or standardization is welcome.

Gareth Harris
gharris@nrao.edu
2001-08-17T21:36:00Z


----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2002-01-01 12:27

Message:
Logged In: YES 
user_id=21627

Gareth,

Can you please propose a strategy to advance this patch or
withdraw it? If there is no action, I propose to close it by
Feb 1, 2002.

----------------------------------------------------------------------

Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2001-12-06 06:57

Message:
Logged In: YES 
user_id=3066

Another possible alternate home for this would be the Python
Snippet repository on SourceForge:

http://sourceforge.net/snippet/browse.php?by=lang&lang=6

I'm not suggesting that this doesn't belong in the standard
library, however.

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2001-09-19 10:46

Message:
Logged In: YES 
user_id=21627

Nice patch. If you want to see this included, you should 
complete it: Decide on location of the function, provide 
documentation and test cases. As the location, it may be 
that the calendar module could provide a home, but you may 
ask in the newsgroup.

If you merely wanted to publish this code snippet, I 
suggest that you find a better home than the Python patch 
database, e.g. the Cookbook:

http://aspn.activestate.com/ASPN/Cookbook/Python

There are a number of other places that collect Python 
snippets; this is just one option.


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=452232&group_id=5470