logging date format with milliseconds and timezone

2018-05-17 Thread Skip Montanaro
It seems that the logging.Formatter class uses two formats by default to format a time, default_time_format (%Y-%m-%d %H:%M:%S) and default_msec_format (%s,%03d). The former is a format string for time.strftime (and thus can't represent fractions of a second). The latter accomplishes that, but expa

Re: mssql date format

2016-09-12 Thread Nathan Ernst
Note that this issue is mentioned in the pymssql FAQ: http://pymssql.org/en/stable/faq.html#pymssql-does-not-unserialize-date-and-time-columns-to-datetime-date-and-datetime-time-instances Regards, Nathan On Mon, Sep 12, 2016 at 8:29 PM, Dennis Lee Bieber wrote: > On Tue, 13 Sep 2016 00:52:59 +0

Re: mssql date format

2016-09-12 Thread MRAB
On 2016-09-13 00:06, sum abiut wrote: Thanks for the response, i pulling data from an mssql database and i need to convert the date column. how to i covert and pass it to my template. i am using Django this is what i did conn=pymssql.connect(server,username,password,database) #cus=conn.cu

Re: mssql date format

2016-09-12 Thread sum abiut
Thanks for the response, i pulling data from an mssql database and i need to convert the date column. how to i covert and pass it to my template. i am using Django this is what i did conn=pymssql.connect(server,username,password,database) #cus=conn.cursor() cus=conn.cursor(as_dict=True)

Re: mssql date format

2016-09-11 Thread Chris Angelico
On Mon, Sep 12, 2016 at 11:15 AM, MRAB wrote: > On 2016-09-12 01:37, sum abiut wrote: >> >> Hi, >> I am pulling data from an mssql server database and got a date in this >> format: 733010 >> please advise what of date is this and how to i convert it to a readable >> date? >> >> i use pyssql to con

Re: mssql date format

2016-09-11 Thread MRAB
On 2016-09-12 01:37, sum abiut wrote: Hi, I am pulling data from an mssql server database and got a date in this format: 733010 please advise what of date is this and how to i convert it to a readable date? i use pyssql to connect to the database and pull data fro the database. Does the date "

mssql date format

2016-09-11 Thread sum abiut
Hi, I am pulling data from an mssql server database and got a date in this format: 733010 please advise what of date is this and how to i convert it to a readable date? i use pyssql to connect to the database and pull data fro the database. thanks in advance, cheers -- https://mail.python.org/m

Re: Convert NTP timestamp from NTP packet to System time and date format

2014-01-30 Thread Johannes Findeisen
On Thu, 30 Jan 2014 18:34:04 +0500 Sadia Bashir wrote: > Hello everyone; > > I want to write NTP client which sends and receives NTP packet to NTP > server and should read the value from one of the four offsets and convert > it to user readable local or GMT time format, I specifically want to kno

Re: Convert NTP timestamp from NTP packet to System time and date format

2014-01-30 Thread Chris Angelico
On Fri, Jan 31, 2014 at 12:34 AM, Sadia Bashir <11msccssbas...@seecs.edu.pk> wrote: > Hello everyone; > > I want to write NTP client which sends and receives NTP packet to NTP server > and should read the value from one of the four offsets and convert it to > user readable local or GMT time format,

Convert NTP timestamp from NTP packet to System time and date format

2014-01-30 Thread Sadia Bashir
Hello everyone; I want to write NTP client which sends and receives NTP packet to NTP server and should read the value from one of the four offsets and convert it to user readable local or GMT time format, I specifically want to know which offsets should I read in order to get correct timestamp fr

Re: imaplib AND date format

2010-10-16 Thread Tim Roberts
harryos wrote: >In imaplib.IMAP4.search() the search string SENTON can be used >'(SENTON 22-Jun-2010)' . >But the RFC 2060 defines search key as >SENTON Messages whose [RFC-822] Date: header is within the > specified date. >and in RFC822 it is given as, >date= 1*2D

imaplib AND date format

2010-10-14 Thread harryos
In imaplib.IMAP4.search() the search string SENTON can be used '(SENTON 22-Jun-2010)' . But the RFC 2060 defines search key as SENTON Messages whose [RFC-822] Date: header is within the specified date. and in RFC822 it is given as, date= 1*2DIGIT month 2DIGIT

Re: How to get the date format from the users locale?

2010-06-25 Thread Chris Rebert
On Fri, Jun 25, 2010 at 4:39 AM, Fabio Zadrozny wrote: > I'm trying to get the locale-aware date format but it doesn't seem to > be available through nl_langinfo in python 2.5.4 (windows vista). There is the %x format specifier in the time module, but it doesn't actually te

How to get the date format from the users locale?

2010-06-25 Thread Fabio Zadrozny
I'm trying to get the locale-aware date format but it doesn't seem to be available through nl_langinfo in python 2.5.4 (windows vista). Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] onType "help", "copyright", "credits" or &q

Re: converting string to a date format

2009-12-22 Thread M.-A. Lemburg
tekion wrote: > All, > I know there is a datetime module for converting and manipulate date > format. I have this string date format: 24/Nov/2009:10:39:03 -0500 > and would like to convert it to a date format of "2009-11-24 > 10:39:03". At the moment I am reading datet

Re: converting string to a date format

2009-12-21 Thread Ben Finney
tekion writes: > Ben, > I do not have python 2.6 install, my version of Python is 2.4. Ouch :-( Upgrade as soon as possible, 2.4 is no longer receiving bug fixes http://www.python.org/download/releases/2.4.6/>. > So I guess I am stuck on parsing the string "24/Nov/2009:12:00:00 > -0500" using r

Re: converting string to a date format

2009-12-21 Thread tekion
On Dec 21, 3:05 pm, MRAB wrote: > tekionwrote: > > Ben, > > I do not have python 2.6 install, my version of Python is 2.4. > > Because of my version of Python I believe I have to perform what you > > have suggested: > > > This should, ideally, consist of two separate operations: > > >   * parse th

Re: converting string to a date format

2009-12-21 Thread MRAB
tekion wrote: Ben, I do not have python 2.6 install, my version of Python is 2.4. Because of my version of Python I believe I have to perform what you have suggested: This should, ideally, consist of two separate operations: * parse the string, using a specific format, to create a ‘datetime’

Re: converting string to a date format

2009-12-21 Thread tekion
Ben, I do not have python 2.6 install, my version of Python is 2.4. Because of my version of Python I believe I have to perform what you have suggested: This should, ideally, consist of two separate operations: * parse the string, using a specific format, to create a ‘datetime’ object *

Re: converting string to a date format

2009-12-20 Thread Ben Finney
tekion writes: > I have this string date format: 24/Nov/2009:10:39:03 -0500 and would > like to convert it to a date format of "2009-11-24 10:39:03". This should, ideally, consist of two separate operations: * parse the string, using a specific format, to create a ‘date

Re: converting string to a date format

2009-12-20 Thread MRAB
tekion wrote: All, I know there is a datetime module for converting and manipulate date format. I have this string date format: 24/Nov/2009:10:39:03 -0500 and would like to convert it to a date format of "2009-11-24 10:39:03". At the moment I am reading datetime module trying to fin

converting string to a date format

2009-12-20 Thread tekion
All, I know there is a datetime module for converting and manipulate date format. I have this string date format: 24/Nov/2009:10:39:03 -0500 and would like to convert it to a date format of "2009-11-24 10:39:03". At the moment I am reading datetime module trying to find out if I c

Re: date format

2009-01-21 Thread Tim Chase
Ahmed, Shakir wrote: I am grabbing few fields from a table and one of the columns is in date format. The output which I am getting is "Wed Feb 09 00:00:00 2005" but the data in that column is "02/09/2005" and I need the same format output to insert those recodes into a

date format

2009-01-21 Thread Ahmed, Shakir
I am grabbing few fields from a table and one of the columns is in date format. The output which I am getting is "Wed Feb 09 00:00:00 2005" but the data in that column is "02/09/2005" and I need the same format output to insert those recodes into another table. print my_servic

Re: FTP Date Format Function

2007-06-15 Thread samuraisam
On Jun 14, 10:53 pm, billiejoex <[EMAIL PROTECTED]> wrote: > On 14 Giu, 19:25, samuraisam <[EMAIL PROTECTED]> wrote: > > > > > FTP LST/LIST/NLST date field formatting function for all those seekers > > out there... > > > import time > > import datetime > > > def ftpdateformat(value): > > """For

Re: FTP Date Format Function

2007-06-14 Thread billiejoex
On 14 Giu, 19:25, samuraisam <[EMAIL PROTECTED]> wrote: > FTP LST/LIST/NLST date field formatting function for all those seekers > out there... > > import time > import datetime > > def ftpdateformat(value): > """Formats dates from most FTP servers""" > if ":" in value: # within 6 months >

Re: FTP Date Format Function

2007-06-14 Thread MC
Thank. -- @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

FTP Date Format Function

2007-06-14 Thread samuraisam
FTP LST/LIST/NLST date field formatting function for all those seekers out there... import time import datetime def ftpdateformat(value): """Formats dates from most FTP servers""" if ":" in value: # within 6 months return datetime.datetime( *time.strptime( # have to gu

Re: pymssql and date format

2006-02-17 Thread Steve Holden
pymssql so that it gives > the correct date format? thanks > It doesn't return a format, it returns a value. I presume you are saying that you don't like the way the value prints? Use str() on it: >>> str(datetime.datetime(2006, 2, 16, 17, 50, 19)) '2006-0

pymssql and date format

2006-02-16 Thread eight02645999
hi i am using pymmsql to query a date column in MSSQL database table. However the result shows for example (datetime.datetime(2006, 2, 16, 17, 50, 19) which is supposed to be 2006-02-16 17:50:19.000 anyway to correct query a date column using pymssql so that it gives the correct date format

Re: change date format

2005-08-31 Thread Paul McGuire
Oh, please! Even the most lopsided, opinionated, um, person could have tried, oh, maybe, "time" as a possible module for this function? What next? "Is there a module or class that will convert 'I have no shame. ' to upper case, AND trim the trailing whitespace?" (Hint: it has to do with 'strin

Re: change date format

2005-08-31 Thread alex23
Steve Holden wrote: > He isn't asking for help. He's simply masturbating. Now _that_ is how you kill a thread :) - alex23 -- http://mail.python.org/mailman/listinfo/python-list

Re: change date format

2005-08-31 Thread Steve Holden
alex23 wrote: > Fredrik Lundh wrote: > >>perhaps, but why is he posting apache questions to the python list? > > > The real question is why is he asking for our help at all, given: > > Xah Lee wrote: > >>Fuck the Python programing morons. > He isn't asking for help. He's simply masturbating.

Re: change date format

2005-08-31 Thread alex23
Fredrik Lundh wrote: > perhaps, but why is he posting apache questions to the python list? The real question is why is he asking for our help at all, given: Xah Lee wrote: > Fuck the Python programing morons. - alex23 -- http://mail.python.org/mailman/listinfo/python-list

Re: change date format

2005-08-31 Thread dimitri pater
On 8/31/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: Lars Gustäbel wrote:> Not a single occurrence of the f**k word. You're making progress.perhaps, but why is he posting apache questions to the python list? because we know all, we see all,  we are "Python programing (sic) morons" dimitri -- http:

Re: change date format

2005-08-31 Thread Fredrik Lundh
Lars Gustäbel wrote: > Not a single occurrence of the f**k word. You're making progress. perhaps, but why is he posting apache questions to the python list? -- http://mail.python.org/mailman/listinfo/python-list

Re: change date format

2005-08-31 Thread Lars Gustäbel
[Xah Lee] > Apache by default uses the following format for date: > 30/Aug/2005 > > is there a module that turn this directly into mmdd? Use time.strptime() and time.strftime(). Not a single occurrence of the f**k word. You're making progress. Keep it up! -- Lars Gustäbel [EMAIL PROTECTED]

change date format

2005-08-31 Thread Xah Lee
Apache by default uses the following format for date: 30/Aug/2005 is there a module that turn this directly into mmdd? Xah [EMAIL PROTECTED] ∑ http://xahlee.org/ -- http://mail.python.org/mailman/listinfo/python-list