>
> >
>
> >
>
> http://docs.python.org/2/library/datetime
>
> """ An object of type *time* or *datetime* may be naive or *aware"
>
>
>
> aware refers to time-zone and daylight savings time, such political
>
> ephemerals. Two times can only be changed if one knows they're both in
>
> the
On 12/10/2012 03:52 PM, Steven D'Aprano wrote:
> On Mon, 10 Dec 2012 11:57:37 -0800, noydb wrote:
>
>> I want to compare a user entered date-and-time against the date-and-time
>> of a pdf file. I posted on this (how to get a file's date-time) before,
>> was a
On Monday, December 10, 2012 3:52:55 PM UTC-5, Steven D'Aprano wrote:
> On Mon, 10 Dec 2012 11:57:37 -0800, noydb wrote:
>
>
>
> > I want to compare a user entered date-and-time against the date-and-time
>
> > of a pdf file. I posted on this (how to get a file
On Mon, 10 Dec 2012 11:57:37 -0800, noydb wrote:
> I want to compare a user entered date-and-time against the date-and-time
> of a pdf file. I posted on this (how to get a file's date-time) before,
> was advised to do it like:
>
> import datetime, os, stat
> mt
Found this, and it solved my problem
http://blogs.law.harvard.edu/rprasad/2011/09/21/python-string-to-a-datetime-object/
--
http://mail.python.org/mailman/listinfo/python-list
In <21eb3e6f-9a82-47aa-93ff-8f4083d18...@googlegroups.com> noydb
writes:
> I want to compare a user entered date-and-time against the date-and-time of
> a pdf file. I posted on this (how to get a file's date-time) before, was
> advised to do it like:
> import dat
I want to compare a user entered date-and-time against the date-and-time of a
pdf file. I posted on this (how to get a file's date-time) before, was advised
to do it like:
import datetime, os, stat
mtime = os.lstat(filename)[stat.ST_MTIME] // the files modification tim
John Nagle writes:
>I want to parse standard ISO date/time strings such as
>
> 2012-09-09T18:00:00-07:00
>
> into Python "datetime" objects.
Consider whether RFC 3339 might be a more suitable format.
It is a subset of ISO 8601 extended format. Some of the
Roy Smith writes:
> In article ,
> Chris Angelico wrote:
> > What is it that takes up forty pages [for the ISO 8601
> > specification]? RFC 2822 describes a date/time stamp in about two
> > pages. In fact, the whole RFC describes the Internet Message Format
> >
In article ,
Chris Angelico wrote:
> On Tue, Sep 11, 2012 at 7:46 AM, Rhodri James
> wrote:
> > On Sun, 09 Sep 2012 13:14:30 +0100, Roy Smith wrote:
> >
> >> In article ,
> >> Thomas Jollans wrote:
> >>
> >>> The ISO date/time
On Tue, Sep 11, 2012 at 7:46 AM, Rhodri James
wrote:
> On Sun, 09 Sep 2012 13:14:30 +0100, Roy Smith wrote:
>
>> In article ,
>> Thomas Jollans wrote:
>>
>>> The ISO date/time format is dead simple and well-defined.
>
>
>> Well defined, perhaps. Bu
On Sun, 09 Sep 2012 13:14:30 +0100, Roy Smith wrote:
In article ,
Thomas Jollans wrote:
The ISO date/time format is dead simple and well-defined.
Well defined, perhaps. But nobody who has read the standard could call
it "dead simple". ISO-8601-2004(E) is 40 pages long.
In article ,
Thomas Jollans wrote:
> The ISO date/time format is dead simple and well-defined.
Well defined, perhaps. But nobody who has read the standard could call
it "dead simple". ISO-8601-2004(E) is 40 pages long.
Of course, that fact that it's complicated enough to
On 09/09/2012 11:15, Roy Smith wrote:
In article , John Nagle
wrote:
This really should be handled in the standard library, instead of
everybody rolling their own, badly.
+1
I'll second that given "There should be one-- and preferably only one
--obvious way to do it".
--
Cheers.
Mark
In article , John Nagle
wrote:
> This really should be handled in the standard library, instead of
> everybody rolling their own, badly.
+1
--
http://mail.python.org/mailman/listinfo/python-list
>
> iso-8601 0.2.3 Flexible ISO 8601 parser...
> PySO8601 0.1.7 PySO8601 aims to parse any ISO 8601 date...
> isodate 0.4.8An ISO 8601 date/time/duration parser and formater
>
> All three have been updated this year.
There's another one inside
date...
isodate 0.4.8An ISO 8601 date/time/duration parser and
formater
All three have been updated this year.
--
http://mail.python.org/mailman/listinfo/python-list
* Roy Smith wrote:
> The third is that I never use methods I can't figure out how to
> pronounce.
here: strip'time
nd
--
Flhacs wird im Usenet grundsätzlich alsfhc geschrieben. Schreibt man
lafhsc nicht slfach, so ist das schlichtweg hclafs. Hingegen darf man
rihctig ruhig rhitcgi schreiben, we
On 9/6/2012 3:44 PM, Thomas Jollans wrote:
On 09/06/2012 09:27 PM, John Nagle wrote:
In Python 2.7:
I want to parse standard ISO date/time strings such as
2012-09-09T18:00:00-07:00
into Python "datetime" objects. The "datetime" object off
In article ,
Dave Angel wrote:
> For working with datetime, see
> http://docs.python.org/library/datetime.html#datetime.datetime
>
> and look up datetime.strptime()
strptime has two problems.
One is that it's a pain to use (you have to look up all those
inscrutable %-thingies every time
In article , John Nagle
wrote:
> In Python 2.7:
>
>I want to parse standard ISO date/time strings such as
>
> 2012-09-09T18:00:00-07:00
>
> into Python "datetime" objects. The "datetime" object offers
> an output method , datetimeobj.is
andoned; it hasn't been
>
> >> updated since 2007 and has many outstanding issues.
>
> >
>
> > Hmm, I have some code that uses ISO date/time strings and just checked
>
> > to see how I did it, and it looks like it uses iso8601-0.1.4-py2.6.egg .
>
On 9/6/2012 12:51 PM, Paul Rubin wrote:
> John Nagle writes:
>> There's an iso8601 module on PyPi, but it's abandoned; it hasn't been
>> updated since 2007 and has many outstanding issues.
>
> Hmm, I have some code that uses ISO date/time strings and just c
On 09/06/2012 03:27 PM, John Nagle wrote:
> In Python 2.7:
>
>I want to parse standard ISO date/time strings such as
>
> 2012-09-09T18:00:00-07:00
>
> into Python "datetime" objects. The "datetime" object offers
> an output method , dateti
John Nagle writes:
> There's an iso8601 module on PyPi, but it's abandoned; it hasn't been
> updated since 2007 and has many outstanding issues.
Hmm, I have some code that uses ISO date/time strings and just checked
to see how I did it, and it looks like it uses iso8601-0.1.
On 09/06/2012 09:27 PM, John Nagle wrote:
> In Python 2.7:
>
>I want to parse standard ISO date/time strings such as
>
> 2012-09-09T18:00:00-07:00
>
> into Python "datetime" objects. The "datetime" object offers
> an output method , dateti
In Python 2.7:
I want to parse standard ISO date/time strings such as
2012-09-09T18:00:00-07:00
into Python "datetime" objects. The "datetime" object offers
an output method , datetimeobj.isoformat(), but not an input
parser. There ought to be
This was a long time ago But just in case anyone googling ever has
the same question, this is what I did (last year). The user just needs
to supply a strftime formatted string, such as "%A, %e %b %h:%M" and
this Class figures out the regex to use on the log entries...
class RegexBuilder(object
On Thu, Jul 22, 2010 at 5:54 AM, kak...@gmail.com wrote:
> Well i have the following number 1279796174846
> i did the following:
>
> mdate = 1279796174846
> tempStr = str(mdate)
> tempStr2 = tempStr[:-3]
> tempInt = int(tempStr2)
> print "Last Login :", datetime.datetime.fromtimestamp(tempInt)
>
Well i have the following number 1279796174846
i did the following:
mdate = 1279796174846
tempStr = str(mdate)
tempStr2 = tempStr[:-3]
tempInt = int(tempStr2)
print "Last Login :", datetime.datetime.fromtimestamp(tempInt)
that prints out: 2010-07-22 06:56:14
But when i check my answer at http://
On Apr 26, 8:21 am, rk wrote:
> Hi,
>
> I am python novice, trying to convert a boost::gregorian::date out to
> python using PyDateTime C-api interface. I was coring because the C-
> API failed to initialize. The error was:
>
> AttributeError: "module" object has not attribute datetime_CAPI
>
> A
Hi,
I am python novice, trying to convert a boost::gregorian::date out to
python using PyDateTime C-api interface. I was coring because the C-
API failed to initialize. The error was:
AttributeError: "module" object has not attribute datetime_CAPI
As indicated by the error, a dir(datetime) give
On Aug 22, 5:11 pm, Kushal Kumaran
wrote:
> On Fri, Aug 21, 2009 at 11:44 PM, Ronn Ross wrote:
> > I'm new to python and I'm getting a date time from a field in the database
> > that looks like this:
> > 8/2/2009 8:36:16 AM (UTC)
> datetime.datetime.strptime
On Fri, Aug 21, 2009 at 11:44 PM, Ronn Ross wrote:
> I'm new to python and I'm getting a date time from a field in the database
> that looks like this:
> 8/2/2009 8:36:16 AM (UTC)
>
> I want to split it into two fields one with the date formatted like this:
> -M
On Fri, 21 Aug 2009 14:43:55 -0400
Ronn Ross wrote:
> On Fri, Aug 21, 2009 at 2:26 PM, D'Arcy J.M. Cain wrote:
> > You don't say what database you are using but you may find it simpler
> > to do the conversion in your SELECT statement. For example, see
> > http://www.postgresql.org/docs/8.3/stat
On Fri, Aug 21, 2009 at 2:26 PM, D'Arcy J.M. Cain wrote:
> On Fri, 21 Aug 2009 14:14:32 -0400
> Ronn Ross wrote:
> > I want to split it into two fields one with the date formatted like this:
> > -MM-DD 2009-08-02
> >
> > and the time to be 24 hour or military time. How every you call it.
>
On Fri, 21 Aug 2009 14:14:32 -0400
Ronn Ross wrote:
> I want to split it into two fields one with the date formatted like this:
> -MM-DD 2009-08-02
>
> and the time to be 24 hour or military time. How every you call it. Similar
> to this:
> 15:22:00
>
> I found it easy to truncate off the (
I'm new to python and I'm getting a date time from a field in the database
that looks like this:
8/2/2009 8:36:16 AM (UTC)
I want to split it into two fields one with the date formatted like this:
-MM-DD 2009-08-02
and the time to be 24 hour or military time. How every you call i
On 2009-02-10 10:26, Phillip B Oldham wrote:
> Is there a simple way to set a date/time and convert it to a unix
> timestamp? After some googling I found the following:
>
> t = datetime.time(7,0,0)
> starttime = time.mktime(t.timetuple())+1e-6*t.microsecond
>
> That seems
"naive" and "aware" objects).
anyway, ignoring that, i think you need the very useful, but oddly
located, calendar.timegm().
andrew
Phillip B Oldham wrote:
> Is there a simple way to set a date/time and convert it to a unix
> timestamp? After some googling I
Phillip B Oldham schrieb:
Is there a simple way to set a date/time and convert it to a unix
timestamp? After some googling I found the following:
t = datetime.time(7,0,0)
starttime = time.mktime(t.timetuple())+1e-6*t.microsecond
That seems like very long-winded. Is there an easier way? I
Is there a simple way to set a date/time and convert it to a unix
timestamp? After some googling I found the following:
t = datetime.time(7,0,0)
starttime = time.mktime(t.timetuple())+1e-6*t.microsecond
That seems like very long-winded. Is there an easier way? I've read
the docs on the dat
That, my friend, is ingenious...!
Thankyou
SM
2009/2/3 andrew cooke
> > > ValueError: unconverted data remains: this is the remainder of the log
>
> > > line
> > > that I do not care about
>
> you could catch the ValueError and split at the ':' in the .args
> attribute to find the extra data.
> > ValueError: unconverted data remains: this is the remainder of the log
> > line
> > that I do not care about
you could catch the ValueError and split at the ':' in the .args
attribute to find the extra data. you could then find the extra data
in the original string, use the index to remove
ot;", line 1, in
File "/opt/local/lib/python2.5/_strptime.py", line 333, in strptime
data_string[found.end():])
ValueError: unconverted data remains: this is the remainder of the log
line
that I do not care about
If the logfile has fixed width fields, you may ask the use
Simon Mullis wrote:
> Hi All
>
> I'm writing a script to help with analyzing log files timestamps and
> have a very specific question on which I'm momentarily stumped
>
> I'd like the script to support multiple log file types, so allow a
> strftime format to be passed in as a cli switch (defau
Hi All
I'm writing a script to help with analyzing log files timestamps and have a
very specific question on which I'm momentarily stumped
I'd like the script to support multiple log file types, so allow a strftime
format to be passed in as a cli switch (default is %Y-%m-%d %H:%M:%S).
When i
09:00 on 1 June will appear to
have been modified at 08:00 if viewed during non-DST!
MRAB a écrit :
m.banaouas wrote:
hi,
I noticed recently that the value of file date/time I get with python:
time.strftime('%Y-%m-%d %H:%M', time.gmtime(os.stat(fullname).st_mtime))
is forwarding
puter-folder.
I gess that if computers of those users are in different timezones, they could
see different file date ?
MRAB a écrit :
> m.banaouas wrote:
>> hi,
>>
>> I noticed recently that the value of file date/time I get with python:
>> time.strftime('%Y-%m-%d
m.banaouas wrote:
hi,
I noticed recently that the value of file date/time I get with python:
time.strftime('%Y-%m-%d %H:%M', time.gmtime(os.stat(fullname).st_mtime))
is forwarding by one hour the real file date/time.
Example:
file A.txt: 2009-01-18 16:13
returned valeur: 2009-01-28
hi,
I noticed recently that the value of file date/time I get with python:
time.strftime('%Y-%m-%d %H:%M', time.gmtime(os.stat(fullname).st_mtime))
is forwarding by one hour the real file date/time.
Example:
file A.txt: 2009-01-18 16:13
returned valeur: 2009-01-28 15:13
Is there a
Thierry Lam wrote:
I have a python time string which has the following value:
1225137896
The above corresponds to 2008/10/27 16:04:56
What can I use to convert 1225137896 to a more readable date, time
format?
(1) Read Smart Questions [you could at least have told us where this
number came
On Mon, Oct 27, 2008 at 4:45 PM, Thierry Lam <[EMAIL PROTECTED]> wrote:
> I have a python time string which has the following value:
>
> 1225137896
>
> The above corresponds to 2008/10/27 16:04:56
>
> What can I use to convert 1225137896 to a more readable date, tim
I have a python time string which has the following value:
1225137896
The above corresponds to 2008/10/27 16:04:56
What can I use to convert 1225137896 to a more readable date, time
format?
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 7, 5:26 pm, [EMAIL PROTECTED] wrote:
> On Mar 7, 4:22 pm, [EMAIL PROTECTED] wrote:
> [snip]> Although if I end up writing my own I'll sure use
> > datetime.parser.parse to get everything left over once you remove
>
> I mean dateutil.parser.parse. Tomorrow I'll have to leave off the last
> Lu
Hello Guys,
I'm using the python logging module, however I'm not happy with the current
date/time format which is used to write the timestamp into the log file. I
need the logger to write the stamp without the milliseconds appended too it.
This is because I use a 3rd party applicatio
[EMAIL PROTECTED] writes:
>I'm new to python and I was wondering if there are any intelligent
>date/time parsing modules out there. I've looked at strptime (or
>whichever it is) and mxDateTime from the eGenix package. I need
>something to parse user input for a django app,
On Mar 8, 12:57 pm, Tim Chase <[EMAIL PROTECTED]> wrote:
> > I am a GNU newbie. (I know C &o.) Can you point me to a
> > place to find the source for 'date'?
>
> It's part of the GNU Coreutils:
>
> http://ftp.gnu.org/gnu/coreutils/
>
> Within the file, you're likely interested in lib/getdate.*
>
> I am a GNU newbie. (I know C &o.) Can you point me to a
> place to find the source for 'date'?
It's part of the GNU Coreutils:
http://ftp.gnu.org/gnu/coreutils/
Within the file, you're likely interested in lib/getdate.*
It helps if you have a working knowledge of Yacc.
-tkc
--
http://ma
On Mar 7, 9:23 pm, [EMAIL PROTECTED] wrote:
> I figured I might as well share the code I ended up using, in case
> anyone else wants an easy way to get strings to, for instance, SQL-
> storable datetimes.
>
> [EMAIL PROTECTED]:~$ cat test.py
> #!/usr/bin/python
> from datetime import datetime
> imp
I figured I might as well share the code I ended up using, in case
anyone else wants an easy way to get strings to, for instance, SQL-
storable datetimes.
[EMAIL PROTECTED]:~$ cat test.py
#!/usr/bin/python
from datetime import datetime
import subprocess
def parsedate( date ):
p = subprocess.P
On Mar 7, 5:00 pm, [EMAIL PROTECTED] wrote:
> On Mar 7, 4:35 pm, Jeffrey Froman <[EMAIL PROTECTED]> wrote:
>
> > [EMAIL PROTECTED] wrote:
> > > I need
> > > something to parse user input for a django app, and it's awesome to be
> > > able to write "last monday", "a year ago", or "10pm tuesday" like
On Mar 7, 4:35 pm, Jeffrey Froman <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > I need
> > something to parse user input for a django app, and it's awesome to be
> > able to write "last monday", "a year ago", or "10pm tuesday" like
> > PHP's strtotime.
>
> Django comes with some pretty
On Mar 7, 4:33 pm, Carl Banks <[EMAIL PROTECTED]> wrote:
> On Mar 7, 5:08 pm, [EMAIL PROTECTED] wrote:
>
> > I'm new to python and I was wondering if there are any intelligent
> > date/time parsing modules out there. I've looked at strptime (or
> > whichev
[EMAIL PROTECTED] wrote:
> I need
> something to parse user input for a django app, and it's awesome to be
> able to write "last monday", "a year ago", or "10pm tuesday" like
> PHP's strtotime.
Django comes with some pretty handy filters for doing this sort of
formatting. Check out the "date", "n
On Mar 7, 5:08 pm, [EMAIL PROTECTED] wrote:
> I'm new to python and I was wondering if there are any intelligent
> date/time parsing modules out there. I've looked at strptime (or
> whichever it is) and mxDateTime from the eGenix package. I need
> something to parse user
On Mar 7, 4:22 pm, [EMAIL PROTECTED] wrote:
[snip]
> Although if I end up writing my own I'll sure use
> datetime.parser.parse to get everything left over once you remove
I mean dateutil.parser.parse. Tomorrow I'll have to leave off the last
Lunchtime Guiness.
> strings like "this saturday". So it
On Mar 7, 4:10 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote:
> On Mar 7, 4:08 pm, [EMAIL PROTECTED] wrote:
>
> > I'm new to python and I was wondering if there are any intelligent
> > date/time parsing modules out there. I've looked at strptime (or
> >
On Mar 7, 4:10 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote:
> On Mar 7, 4:08 pm, [EMAIL PROTECTED] wrote:
>
> > I'm new to python and I was wondering if there are any intelligent
> > date/time parsing modules out there. I've looked at strptime (or
> >
On Mar 7, 4:08 pm, [EMAIL PROTECTED] wrote:
> I'm new to python and I was wondering if there are any intelligent
> date/time parsing modules out there. I've looked at strptime (or
> whichever it is) and mxDateTime from the eGenix package. I need
> something to parse user
On Mar 7, 4:08 pm, [EMAIL PROTECTED] wrote:
> I'm new to python and I was wondering if there are any intelligent
> date/time parsing modules out there. I've looked at strptime (or
> whichever it is) and mxDateTime from the eGenix package. I need
> something to parse user
I'm new to python and I was wondering if there are any intelligent
date/time parsing modules out there. I've looked at strptime (or
whichever it is) and mxDateTime from the eGenix package. I need
something to parse user input for a django app, and it's awesome to be
able to write &q
On Jan 26, 12:48 am, goldtech <[EMAIL PROTECTED]> wrote:
> snip
>
>
>
> > try this:
>
> > val = oRS.Fields(dt).Value
> > print type(val)
>
> this gives:
>
> > print float(val)
>
> yes, it gives 0.0
>
> But there should be a way to print what is *actually in the field*.
What is "actually in the f
On Jan 25, 7:48 am, goldtech <[EMAIL PROTECTED]> wrote:
> snip
>
>
>
> > try this:
>
> > val = oRS.Fields(dt).Value
> > print type(val)
>
> this gives:
>
> > print float(val)
>
> yes, it gives 0.0
>
> But there should be a way to print what is *actually in the field*.
> When I open the DB table i
snip
>
> try this:
>
> val = oRS.Fields(dt).Value
> print type(val)
this gives:
> print float(val)
yes, it gives 0.0
But there should be a way to print what is *actually in the field*.
When I open the DB table in Access I see: 12:00:00 AM.
That's what I want - the value, and the form of th
On Jan 25, 10:55 am, goldtech <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Given an MS-Access table with a date type field with a value of:
> 12:00:00 AM - just"12:00:00 AM", there's nothing else in the field.
>
> I want to print exactly what's in the field, ie. "12:00:00 AM". What I
> get printed is: 12
On Jan 24, 5:55 pm, goldtech <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Given an MS-Access table with a date type field with a value of:
> 12:00:00 AM - just"12:00:00 AM", there's nothing else in the field.
>
> I want to print exactly what's in the field, ie. "12:00:00 AM". What I
> get printed is: 12/
Hi,
Given an MS-Access table with a date type field with a value of:
12:00:00 AM - just"12:00:00 AM", there's nothing else in the field.
I want to print exactly what's in the field, ie. "12:00:00 AM". What I
get printed is: 12/30/0/ 00:00:00
I try:
import win32com.client
from win32.client imp
I am looking for a simple Python function for handling a set of time
series data. For instance, I might have the following raw data
(year's worth):
1/1/200512:00 AM11.24
1/1/200512:10 AM12.31
1/1/200512:20 AM12.06
1/1/200512:30 AM11.
[EMAIL PROTECTED] wrote:
>> The problem is, how do I create a datetime object and tell it that it's
>> America/Anchorage *daylight savings time* instead of whatever the system
>> is
>> currently set at? pytz only has America/Anchorage, and I saw no way to
>> tell it explicitly that the timezone i
Joshua J. Kugler wrote:
> I've read docs (datetime, time, pytz, mx.DateTime), googled, and
> experimented. I still don't know how to accomplish what I want to
> accomplish.
>
> I'm loading up a bunch of date/time data that I then need to do math on to
> compar
I've read docs (datetime, time, pytz, mx.DateTime), googled, and
experimented. I still don't know how to accomplish what I want to
accomplish.
I'm loading up a bunch of date/time data that I then need to do math on to
compare it to the current date/time. I can get the current tim
Nico Grubert skrev:
> you could do this:
>
> >>> a = datetime.datetime(2006, 5, 24, 16, 1, 26)
> >>> b = datetime.datetime(2006, 5, 20, 12, 1, 26)
> >>> a-b
> datetime.timedelta(4)
> # 4 days
Or
#v+
>>> print (a-b).days
4
>>>
#v-
Mvh,
--
Klaus Alexander Seistrup
SubZeroNet, Copenhagen, De
And if you want the number of days:
py> d = datetime.datetime(2006,5,24,16,34) -
datetime.datetime(2006,5,23,12,1)
py> d.days
1
py> d = datetime.datetime(2006,5,24,16,34) -
datetime.datetime(2006,5,23,19,1)
py> d.days
0
--
http://mail.python.org/mailman/listinfo/python-list
> I use datetime class in my program and now
> I have two fields that have the datetime format like this
> datetime.datetime(2006, 5, 24, 16, 1, 26)
> How can I find out the date/time difference ( in days) of such two
> fields?
Hi Lad,
you could do this:
>>> a
Lad skrev:
> How can I find out the date/time difference ( in days) of such
> two fields?
Did you try to subtract one value from the other?
Mvh,
--
Klaus Alexander Seistrup
SubZeroNet, Copenhagen, Denmark
http://magnetic-ink.dk/
--
http://mail.python.org/mailman/listinfo/python-list
Convert datetime.datetime(2006, 5, 24, 16, 1, 26) to an ordinal number
like:
datetime.datetime(2006, 5, 24, 16, 1, 26).toordinal()
and subtract them to get number of days.
--
http://mail.python.org/mailman/listinfo/python-list
I use datetime class in my program and now
I have two fields that have the datetime format like this
datetime.datetime(2006, 5, 24, 16, 1, 26)
How can I find out the date/time difference ( in days) of such two
fields?
Thank you for help?
L
--
http://mail.python.org/mailman/listinfo/python
Thanks very much for that roger :-)
I changed my code to
filehandle = win32file.CreateFile(file, win32file.GENERIC_WRITE,
win32file.FILE_SHARE_WRITE, None, win32con.OPEN_ALWAYS,
win32con.FILE_FLAG_BACKUP_SEMANTICS, None)
nowWin32=pywintypes.Time(theTime)
"ToddLMorgan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> I'm trying to set any of the dates (create, modification, access) of a
> directory under windows with python.
>
> I'm trying to do this as I'm trying to write a unittest for a directory
> cleaning script I'm writing (ie I n
I'm trying to set any of the dates (create, modification, access) of a
directory under windows with python.
I'm trying to do this as I'm trying to write a unittest for a directory
cleaning script I'm writing (ie I need the test to set the create/mod
time for some of the directories so that I can b
Hi,
I got the message of "There was an error in the DDE conversation with
Pythonwin" when I tried to run Pythonwin.
I googled and found the possible solution is:
modify the Pythonwin shortcut to pass a
"/nodde" command-line option.
I got lost how to do that.
Thanks for any help!
--
http://mail.pyt
van der, Tim
Cc: python-list@python.org
Subject: Re: Parsing a date-time
string?
On 21 Dec 2005 01:43:13 -0800, Tim N. van der Leeuw <[EMAIL PROTECTED]>
wrote:
Hi,
I want to parse strings containing date-time, which look like the
following:
"Mon Dec 19 11:06:12:333 CET 200
"Tim N. van der Leeuw" <[EMAIL PROTECTED]> wrote:
>
>I want to parse strings containing date-time, which look like the
>following:
>
> "Mon Dec 19 11:06:12:333 CET 2005"
>
>That's a problem for strptime it seems, b/c I cannot find any
>forma
On 21 Dec 2005 01:43:13 -0800, Tim N. van der Leeuw <[EMAIL PROTECTED]> wrote:
Hi,I want to parse strings containing date-time, which look like thefollowing:
"Mon Dec 19 11:06:12:333 CET 2005"[snipped]What I want to get is some sort of sortable date; either as a number or(if no
I downloaded the tar.bz2 file, extracted it, and had no problem
building it and creating a windows installer using 'python ./setup.py
bdist_wininst'
This windows installer I then used to install it via the 'official
windows' way :)
luck,
--Tim
--
http://mail.python.org/mailman/listinfo/python-
y_number = s[3]
In [9]: time = s[4]
In [10]: #
? So you treat the datetime information using regex or another split method.
Cheers =]
Sent from the Python - python-list forum at Nabble.com:
Re: Parsing a date-time string?
--
http://mail.python.org/mailman/listinfo/python-list
I did check and found 'dateutil' is under
the folder of python-dateutil-1.0
very confused, :(
On 12/21/05, linda.s <[EMAIL PROTECTED]> wrote:
> Hi Fuzzyman,
> I also wanted to install the DateUtil module from
> http://labix.org/python-dateutil
> but had problems (using Windows).
> C:\Python24>pyth
Hi Fuzzyman,
I also wanted to install the DateUtil module from
http://labix.org/python-dateutil
but had problems (using Windows).
C:\Python24>python python-dateutil-1.0\setup.py build
running build
running build_py
error: package directory 'dateutil' does not exist
Can you tell me why?
Linda
On 21
Quick response - there is a DateUtil module with a *very* flexible
string-to-date parser. It will almost certainly do what you want :
http://labix.org/python-dateutil
All the best,
Fuzzyman
http://www.voidspace.org.uk/python/index.shtml
--
http://mail.python.org/mailman/listinfo/python-list
1 - 100 of 117 matches
Mail list logo