i have date in string in this format
eg. 1/20/21011 i need to convert it into the date object
- >>> import time
-
>>> s = "1/20/2011"
-
>>> time.strptime(s, "%m/%d/%Y")
-
(2011, 1, 20, 0, 0, 0, 3, 20, -1)
-
>>>
4 3636 bvdet 2,851
Expert Mod 2GB - >>> import time
-
>>> s = "1/20/2011"
-
>>> time.strptime(s, "%m/%d/%Y")
-
(2011, 1, 20, 0, 0, 0, 3, 20, -1)
-
>>>
thanks i tried it and it works fine i alos tried same for time also but i get problem when the time is provide in this format
10:30:00 AM
bvdet 2,851
Expert Mod 2GB - >>> import time
-
>>> s = "1/20/2011 10:30:00 AM"
-
>>> time.strptime(s, "%m/%d/%Y %I:%M:%S %p")
-
(2011, 1, 20, 10, 30, 0, 3, 20, -1)
-
>>> time.strptime("1/20/2011 10:30:00 PM", "%m/%d/%Y %I:%M:%S %p")
-
(2011, 1, 20, 22, 30, 0, 3, 20, -1)
-
>>>
Sign in to post your reply or Sign up for a free account.
Similar topics
by: JimMenees |
last post by:
I know there's an easy answer to this which is escaping me:
--------------------------------------------------------------------------
-----------------------
I have clickable thumb images which...
|
by: Mick White |
last post by:
According to the Safari browser the world began on "Fri Dec 13 1901
15:45:52 GMT-0500", but I need to be able to get around this limitation.
I am interested in dates from 1500 to 1901, as far as...
|
by: Abhishek Srivastava |
last post by:
Hello All,
I wrote the following program.
using System;
using System.Globalization;
public class ShortDateTest
{
public static void Main(string args)
|
by: ABC |
last post by:
How to convert a date string to datetime value with custom date format?
e.g.
Date String Date Format Result (DateTime value)
"05/07/2004" "MM/dd/yyyy" May 7, 2004
"01062005" ...
|
by: Sam |
last post by:
How do I convert Julian Date to Calendar Date in ASP.Net 1.1 based on
following guideline found at Internet?
To convert Julian date to Gregorian date:
double JD = 2299160.5;
double Z =...
|
by: xendrax |
last post by:
I was told on this site eval was bad but its the only way i can work out how to do it.. their example was
use var imdesc = document.myform.value
not var imdesc = eval("document.myform." +...
|
by: XML newbie: Urgent pls help! |
last post by:
function to convert string to 1 dimensional array of long in VB.Net
|
by: Gretsch |
last post by:
Hi,
I have some XML data which contains a date in dd/mm/yyyy format (ie UK date format).
In javascript I need to read this date then calculate the age (in days& decimals) of the XML data.
I...
|
by: devonknows |
last post by:
Hi, The problem im having is, Im creating a user control. The user (via the Property Page's) will set his own menu titles, and the choose a form of which that title links to. If that makes sense.
...
|
by: Tony B |
last post by:
I'm looking to convert a string in "dd/MM/yy" format into a date object. How
do I go about this ?
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |