>time.strftime %T missing in 2.3

  • Thread starter Andy Leszczynski
  • Start date
R

Robert Kern

Andy said:
Python 2.2/Unix

'22:12:17'

Python 2.3/Windows

''

From http://docs.python.org/lib/node252.html

"""The full set of format codes supported varies across platforms,
because Python calls the platform C library's strftime() function, and
platform variations are common."""

So I suggest that it's a platform issue, not a Python version issue. FWIW:

Python 2.4.1 (#2, Mar 31 2005, 00:05:10)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin
Type "help", "copyright", "credits" or "license" for more information.'22:50:59'

--
Robert Kern
(e-mail address removed)

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
 
A

Andy Leszczynski

Robert said:
Andy said:
Python 2.2/Unix

'22:12:17'

Python 2.3/Windows

''


From http://docs.python.org/lib/node252.html

"""The full set of format codes supported varies across platforms,
because Python calls the platform C library's strftime() function, and
platform variations are common."""

So I suggest that it's a platform issue, not a Python version issue. FWIW:

Python 2.4.1 (#2, Mar 31 2005, 00:05:10)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin
Type "help", "copyright", "credits" or "license" for more information.'22:50:59'

I accept that, but still pain. Took me a while to filter out the problem
in the code running on the Unix and not on M$.

A.
 
M

Michael Hoffman

Andy said:
I accept that, but still pain. Took me a while to filter out the problem
in the code running on the Unix and not on M$.

This is one of the reasons I usually use Cygwin Python when I can. Stuff
is much less likely to mysteriously break when moving from UNIX to
Cygwin then from UNIX to Windows.
 
J

Jorgen Grahn

Robert said:
Andy said:
Python 2.2/Unix

time.strftime("%T")
'22:12:15'
time.strftime("%X")
'22:12:17'

Python 2.3/Windows

time.strftime("%X")
'22:12:47'
time.strftime("%T")
''


From http://docs.python.org/lib/node252.html

"""The full set of format codes supported varies across platforms,
because Python calls the platform C library's strftime() function, and
platform variations are common."""

So I suggest that it's a platform issue, not a Python version issue. FWIW:

Python 2.4.1 (#2, Mar 31 2005, 00:05:10)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import time
time.strftime("%T") '22:50:49'
time.strftime("%X")
'22:50:59'

I accept that, but still pain. Took me a while to filter out the problem
in the code running on the Unix and not on M$.

I can imagine ...

By the way, you should probably /not/ change %T to %X.

%T (standardized in the Singe Unix Specification) is the same thing as ANSI
C %H:%M:%S which should be usable everywhere. %X on the other hand is "The
preferred time representation for the current locale without the date".
Not the same thing at all, for some users.

/Jorgen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top