how to convert GMT timestemp to apoch timestemp ?

A forum for general discussion of the Python programming language.

how to convert GMT timestemp to apoch timestemp ?

Postby vijaykumbhani » Fri Aug 30, 2013 10:27 am

please give me detail of method or give me algorithms ....
[b][i]With Regards,
Vijay Kumbhani[/i][/b]
vijaykumbhani
 
Posts: 33
Joined: Wed Aug 14, 2013 4:26 am
Location: Surat, Gujarat, India

Re: how to convert GMT timestemp to apoch timestemp ?

Postby metulburr » Fri Aug 30, 2013 11:00 am

this might not be the best method on doing this:


Code: Select all
import datetime
f = '%Y-%m-%d'
s = '2013-01-01'
print(datetime.datetime.strptime(s, f).strftime('%s'))
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1470
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: how to convert GMT timestemp to apoch timestemp ?

Postby vijaykumbhani » Fri Aug 30, 2013 11:47 am

i know this method
but how works internal calculation apoch timestemp ?
[b][i]With Regards,
Vijay Kumbhani[/i][/b]
vijaykumbhani
 
Posts: 33
Joined: Wed Aug 14, 2013 4:26 am
Location: Surat, Gujarat, India

Re: how to convert GMT timestemp to apoch timestemp ?

Postby metulburr » Fri Aug 30, 2013 12:02 pm

read the C code of datetime.datetime.strptime
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1470
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY


Return to General Discussions

Who is online

Users browsing this forum: No registered users and 2 guests