[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: QDateTime -> time_t ??
From:       Nicolas Goutte <nicog () snafu ! de>
Date:       2002-08-20 12:17:31
[Download RAW message or body]

You need to use the C functions, there is not any QT function to do it.

I am not sure which one in this case but try to look at:
#include <sys/time.h>
#include <time.h>

To see roughly what to do look at the file koffice/lib/store/kozip.cpp.

In the function transformToMsDos, you have all the QT functions that you have 
to call for spliting the date/time. Here it is used to generate a MSDOS time, 
you would need to generate something else. (You have also a function 
getActualTime if it is by chance what you are looking for.)

Have a nice day/evening/night!

PS.: also be careful that QDateTime::setTime_t() is local time not UTC. (I 
felt into this trap, perhaps someone else could fall into it too.)

On Dienstag, 20. August 2002 13:51, Michael Goffioul wrote:
> Might sound stupid, but I couldn't find any convenient method or
> function to convert a QDateTime to time_t (secs from 01/01/1970),
> that is the counter-part of QDateTime::setTime_t().
> Did I miss something?
>
> Michael.

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic