Re: how to convert ascii time to seconde ( epoch time )
From: Måns Rullgård (mru_at_inprovide.com)
Date: 03/01/05
- Next message: John Hasler: "Re: Wanted: C++ Audio Programmer For Exciting Project Team"
- Previous message: John Fusco: "Re: how to convert ascii time to seconde ( epoch time )"
- In reply to: John Fusco: "Re: how to convert ascii time to seconde ( epoch time )"
- Next in thread: John Fusco: "Re: how to convert ascii time to seconde ( epoch time )"
- Reply: John Fusco: "Re: how to convert ascii time to seconde ( epoch time )"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 01 Mar 2005 01:37:57 +0100
John Fusco <fusco_john@yahoo.com> writes:
> Josef Moellers wrote:
>> google-rambo88 wrote:
>>
>>> Hello.
>>> time_t t;
>>> struct tm * tblock;
>>> t = time ( NULL );
>>> tblock = localtime(&t);
>>>
>>> printf( "long = %ld , Local time is: %s", t1, asctime(tblock)) );
>>> ==>Sun Sep 16 01:03:52 1973
>>>
>>> I'd like to know how to convert ascii time to epoch time(second).
>>> namely , Sun Sep 16 01:03:52 1890 ==> epoch time in second?
>> You'll need to convert the string into a struct tm and then call
>> mktime().
>
> You might want to look at Python's strptime() in the time package.
Anything wrong with strptime() in C?
-- Måns Rullgård mru@inprovide.com
- Next message: John Hasler: "Re: Wanted: C++ Audio Programmer For Exciting Project Team"
- Previous message: John Fusco: "Re: how to convert ascii time to seconde ( epoch time )"
- In reply to: John Fusco: "Re: how to convert ascii time to seconde ( epoch time )"
- Next in thread: John Fusco: "Re: how to convert ascii time to seconde ( epoch time )"
- Reply: John Fusco: "Re: how to convert ascii time to seconde ( epoch time )"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|