Re: Unix Time assistance


Subject: Re: Unix Time assistance
From: Peter Q. Olsson (olsson@koyukuk.at.uaa.alaska.edu)
Date: Tue Apr 22 2003 - 13:02:37 AKDT


Brian-

If you are into perl, it has a number of functions (gmtime, localtime) that do a
nice job of converting from epoch time to more usable formats. The perl camel
book has the needed info.

If you are not into perl, maybe this suggestion is moot.... or maybe you should
join the perl ranks...

Good luck

PQO
>
> Alright, Unix time is seconds since the standar epoch 1970-01-01. Does
>anyone know the math to convert a standard date (ex: 2003-04-22) into a unix
>time, and how to convert a Unix time back into that same date?
>
>I figured you could do it by processing each value:
>1 year = 31536000 seconds: 2003 = 1040688000
>1 day = 86400 seconds: 22 = 1814400
>but then there are months and leap years, so this value is probably incorrect
>as it is. I was wondering if anyone knew how to make this conversion without
>the use of say php functions like time(). I need to do the conversion from
>within a WSH script and export the result into a mySQL formatted file.
>
>
>
> Brian ThunderEagle
> - http://www.swjedi.net
> - furbs@swjedi.net
> - bthundereagle@aidea.org
>
>
>
>
>
>
>
>
>---------
>To unsubscribe, send email to <aklug-request@aklug.org>
>with 'unsubscribe' in the message body.
>

    __________________________________________________________________
   | |
   | Dr. Peter Q. Olsson, |
   | Chief Scientist, Alaska Experimental Forecast Facility |
   | University of Alaska Anchorage |
   | 2811 Merrill Field Drive |
   | Anchorage, AK 99501 |
   | voice: (907) 264-7449 |
   | fax : (907) 264-7444 |
   | olsson@aeff.at.uaa.alaska.edu |
   |__________________________________________________________________|

---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.



This archive was generated by hypermail 2a23 : Tue Apr 22 2003 - 13:05:19 AKDT