If you mean you are writing/testing code on windows and uploading to Unix then don't worry things will work as expected ie localtime() will do the right thing. time and localtime() in Perl are really just 'wrappers' around lower level system library calls of the same name. Most (gulp) modern OSes support theses calls,
mitd-Made in the Dark
'Interactive! Paper tape is interactive!
If you don't believe me I can show
you my paper cut scars!' | [reply] |
what im realy interested is on the time() function and not so much on localtime(), im in editing the time() value before i use it in the localtime() to translate.
To do what i want i need to understand how localtime() translate the time() value? to see if i can add or subtract to get the value that i want or date that i want!
i know that my problem could be solved by creating a table
that will correspond to each week number, but i would like to
achieve this the mathematical way.
| [reply] |
Time usually returns the number of seconds that have passed since January 1st 1970 (GMT). Check it on your platform by using perldoc, type "perldoc -f time" on a command line. You might find the (standard) module Time::Local useful, because it converts arbitrary dates into epoch time, eg;
perl -MTime::Local -e '$time = timegm(0,0,0,1,0,70); print"$time\n"'
Which will print out 0 if your computer uses the standard epoch.
or try:
perl -MTime::Local -e '$time = timelocal(40,46,3,9,8,101); print" $tim
+e\n"'
which will print out "1000000000", because back in November (3:46:40 seconds, November 9th 2001), epoch times started being ten digits.
- Boldra | [reply] [d/l] [select] |
| [reply] |