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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating GMTTime object

Status
Not open for further replies.

drkestrel

MIS
Sep 25, 2000
439
GB
I want to compare a GMTtime object that is read in from string format with the current system GMT Time.

The current GMT Time is
Code:
gmttime time
But I have trouble creating a GMT Time object from a string
dd mm yy
anyway, I have $dd, $mm and $yy initialised accordingly where $dd=1-31;
$mm=1-12
$year= 1900-20xx;

Tried
Code:
$myTime=gmtime($dd,$mm,$year);
but run time error saying wrong number of arguments to gmttime? tried
Code:
$myTime=gmtime(0,0,0,$dd,$mm,$year);
, but no luck either!


 
you need to use the standard distribution module Time::Local, it has the subroutine you need to do this.
read the 'perldoc Time::Local' docs to learn how to use it - they're pretty straight forward and easy to read. "If you think you're too small to make a difference, try spending a night in a closed tent with a mosquito."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top