Hi! Im trying to create a script that would give me a
particular date by giving a week number exp.
First I need to enter fix reference date:
$reftime = 102049345; #(Nov. 5 2001)
#this would be my reference
then the user would enter a week number:
example would give a result like this:
week result
1 Nov. 5 2001 Monday - Nov. 11 2001 Sunday
2 Nov. 12 2001 Monday - Nov. 18 2001 Sunday
~ ~
9 Dec. 24 2001 Monday - Dec. 30 2001 Sunday
10 ~
Now I know that the "time" function returns a long number I think 10 digits,
I need to understand what is being returned by "time" so I
could understand, if it
Is possible to just add an amount to the "time" to get the needed result.
Exp. to get week 1 is : localtime($reftime + (1 * 7))
So basically I just add the number of days to $reftime which is in raw ?time?, but by how much.
And also if it is possible to revert the result of a
localtime(time)
Nov. 11 2001 Sunday = localtime(time) ;
Time = Nov. 11 2001 Sunday #this is for the $reftime,
if I could enter the normal result of A localtime(time) and get the raw "time".
And if there is a script like this that I could study?
Summary:
The meaning of what is returned by ?time?? 1006450348
And if it is possible to revert the result of localtime(time);
or am i a approaching this the wrong way?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.