Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: End of Month Conversions For Date

by little_mistress (Monk)
on Apr 01, 2000 at 06:42 UTC ( [id://6646]=note: print w/replies, xml ) Need Help??


in reply to End of Month Conversions For Date

OK i could help you but i dont know what your data looks like. can you post an example bit your your data?


but other wise it may be the most simple to store the data as the result of the time() function. that way you have the number of seconds since the epoc.

Perl then provides you with a simple way to convert that into plain text.

so here is an example of what im talking about .....

$timestandard = time() - 604800; # time() will give us the number of + seconds since the epoc # time() less 604800 seconds will give us the numbe +r of seconds since the epoc 7 days ago @data=&magic_fucntion_that_opens_the_file_and_gets_the_data(); foreach $d (@data) { push(@save, $d) if $d>$timestandard; } #so now all of the entries that are valid (ie. younger than one week o +ld) are in the array @save #now we print them to the file open(SEZME, ">my_data_file.txt"); $,="\n"; print SEZME @save; close SEZME; undef($,); #the rest of the script.............
I dont know if that will help but ... i dont know how you are storing the time. If you have any control over that at all i would store it as seconds since the epoc ... it makes things so easy

little_mistress@mainhall.com

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://6646]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-19 21:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found