converting string into datetime

0 votes
How to convert a string into datetime in Python?
Aug 7 in Python by Fata
• 1,040 points
20 views

1 answer to this question.

0 votes

You can make use of asctime() method present in the time module.

EXAMPLE:

import time

b=(2019,3,7,10,40,35,1,219,0)

print( time.asctime(b))

OUTPUT:

Tue Mar  7 10:40:35 2019
answered Aug 7 by Wajiha
• 1,920 points

Related Questions In Python

0 votes
1 answer

Split a string into a list of characters

This is easy. Just use the list() ...READ MORE

answered Jun 19, 2018 in Python by Hamartia's Mask
• 1,580 points
28 views
0 votes
1 answer

How to split a string into a list?

You can use the function  text.split() This should be ...READ MORE

answered Jul 30, 2018 in Python by Priyaj
• 56,900 points
59 views
0 votes
1 answer

Convert string list of dict from csv into JSON object in python

You can use the ast module Ex: import ast s = """[{'10': ...READ MORE

answered Sep 12, 2018 in Python by Priyaj
• 56,900 points
512 views
0 votes
1 answer

How to convert string into epoch time?

you are passing the parsed datetime object to ...READ MORE

answered Sep 21, 2018 in Python by SDeb
• 13,160 points
168 views
0 votes
1 answer

Convert string list of dict from csv into JSON object in python

You can use the ast module Ex: import ast s = """[{'10': ...READ MORE

answered Sep 24, 2018 in Python by Priyaj
• 56,900 points
69 views
0 votes
1 answer
0 votes
1 answer

How can I turn an input date into a readable string in Python?

The datetime class has a method strftime. strftime() ...READ MORE

answered Dec 11, 2018 in Python by ariaholic
• 7,340 points
37 views
0 votes
1 answer

Error while converting a list into a numpy array

The only possible reason I could think ...READ MORE

answered Jun 13 in Python by Rhea
41 views
0 votes
1 answer

timedelta in years

Use the following piece of code: x1=datetime.timedelta(days=3000, seconds=0, ...READ MORE

answered Aug 8 in Python by Wajiha
• 1,920 points
111 views
0 votes
1 answer

converting timedelta to float

Use the following piece of code: x1=datetime.timedelta(days=3000, seconds=0, ...READ MORE

answered Aug 8 in Python by Wajiha
• 1,920 points
101 views