[Gambas-user] Timestamp to date

Benoit Minisini gambas at ...1...
Wed Feb 4 20:52:08 CET 2004


On Wednesday 04 February 2004 09:48, Frank Rudolph wrote:
> I would like to transform the Unix Timestamp (seconds from 01.01.1970) into
> a readable date/time Format. The Timestamp Format in PHP is Longint.
> e.G..The command
> to transform date to timestamp is mktime .....
> Frank
>
>

OK ! Try this:

DIM MyDate AS Date
DIM UnixTimeStamp AS Float

MyDate = CDate(CFloat(CDate("01/01/1970"))  + UnixTimeStamp / 86400)

And tell me if it works ! :-)

Note that this formula could be wrong because it seems that sometimes, one or 
two second is added to some years. (man mktime for details)

Regards,

-- 
Benoit Minisini
mailto:gambas at ...1...





More information about the User mailing list