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

Obtain time with a specific format

Status
Not open for further replies.

25230

Programmer
Feb 15, 2002
5
0
0
FR
Hello,

I work with perl 5.6.1 on Windows 2000 plateforme

Is it possible to obtain time with the following format ??

2002.155.20:52

with :
2002 : year with century, as decimal number
155 : day of year as decimal number (001 - 366)
20 : hour in 24-hour format (00 - 23)
52 : minute as decimal number (00 - 59)

The more difficult thing for me is to obtain the day of year as decimal number (001 - 366)
(it's easy to obtain the other parameters with time or localtime function ...)

Thanks a lot for your answer.
 
One of the values returned from the localtime function is the day of the year. ______________________________________________________________________
Perfection in engineering does not happen when there is nothing more to add.
Rather it happens when there is nothing more to take away.
 
@list = localtime;
print $list[5]+1900 . ".$list[7].$list[2]:$list[1]\n";
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top