[Gambas-user] About php timestamp
nando
nando_f at ...951...
Mon Jun 13 21:26:01 CEST 2005
Generally, PHP dates and times are stored as a string
unless you're specifically dealing with the
Unix timestamp (the number of seconds since January 1 1970 00:00:00 GMT)
A quick idea...something like...
unix / 86400 = #days
#days / 365.25 = # years since 1970
#years +1970 is the actual year
The remainder is the number of days in the year..
convert to months
<=31 is Jan
<=31+28 is Feb, Day is remainder - 31
<=31+28+31 is March, Day is remainder -31 - 28
<=31+28+31+30 is April, Day is remainder -31-28-31
...continue for all months
...the remainder is less than 86400 which is the seconds in a day
/ 24 for hours
/ the remainder for minutes
and the remainder is seconds
Hope it helps
-Fernando
---------- Original Message -----------
From: fabien <gambasfr at ...11...>
To: gambas-user at lists.sourceforge.net
Sent: Mon, 13 Jun 2005 20:59:46 +0200
Subject: [Gambas-user] About php timestamp
> Hi to all...
>
> I really need some help. I'm currently rewriting the gambasforge
> site in gambas !
>
> but i've a big problem ! The date of the codes are registred with
> the php timestamp who is mabe the same than unix one. I want to use
> it ! but how converting a gambas Date to a timestamp value ?
>
> Please answer quickly !
> Regards,
> Fabien
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: NEC IT Guy Games. How far can
> you shotput a projector? How fast can you ride your desk chair down
> the office luge track? If you want to score the big prize, get to
> know the little guy. Play to win an NEC 61" plasma display:
http://www.necitguy.com/?r=20
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
------- End of Original Message -------
More information about the User
mailing list