Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date::manip question

Status
Not open for further replies.

aquila125

MIS
Jan 12, 2005
109
BE
Hi all,

Im' writing some scripts to log data into a database. For one of the conversions, I would like to use the UnixDate function in the Manip package to get the unixdate of 30 days ago.

For example:

UnixDate("2005101620:59:59","%s");

gives me 1129492799, but this is 2005-10-17 21:59:59 so it's one hour off.. I'm using CET as the timezone..
What am I doing wrong?

Thanks!
 
if it is always 1 hour off - can't you just subtract an extra hour?

Kind Regards
Duncan
 
What about this:
Code:
my $hour = 20;
my $mins = 59;
my $secs = 59;
my $time = (time - 30*86400) % 86400 + $secs + $mins * 60 + $hour * 3600;


Trojan.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top