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

noreply@sourceforge.net noreply@sourceforge.net
Sun, 28 Jul 2002 04:00:06 -0700


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

Category: Library (Lib)
Group: Python 2.3
>Status: Closed
>Resolution: Rejected
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-07-28 13:00

Message:
Logged In: YES 
user_id=21627

Since no actual patch is forthcoming, I'm rejecting this.

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

Comment By: Martin v. Löwis (loewis)
Date: 2002-03-09 12:40

Message:
Logged In: YES 
user_id=21627

If you want to see the code included, you'd need to provide
a  context diff, including docs and test cases.

However, notice that there may be overlap with the emerging
builtin DateTime type, see

http://www.zope.org/Members/fdrake/DateTimeWiki/FrontPage

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

Comment By: Gareth Harris (garethharris)
Date: 2002-01-02 17:41

Message:
Logged In: YES 
user_id=300900

Back from travel, other projects etc. [2001.01.02]
Thanks for comments thus far.
Maybe I will finally meet some of you in Feb.
---
I proposed to put this in TIME module 
UNLESS someone has an idea for a better location.
Who takes care of that module?
Shall I provide: doc?, test suite?
Is a companion decode function needed?
OTHERWISE I will put it in sourceforge/activestate?
Which is preferred?

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

Comment By: Martin v. Löwis (loewis)
Date: 2002-01-01 21: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 15: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 19: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: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=452232&group_id=5470