'localtime' question

P

PadgeA

Using Linux the following code :

use POSIX qw(strftime);
my $now = strftime "%Y%m%e", localtime;

yields '20070805'

Under Windows the same code yields:

'200708'

Any ideas on how to get the day of the month included using Windows?
 
M

Mr. Shawn H. Corey

Using Linux the following code :

use POSIX qw(strftime);
my $now = strftime "%Y%m%e", localtime;

yields '20070805'

Under Windows the same code yields:

'200708'

Any ideas on how to get the day of the month included using Windows?

Strange, both of them should be: 200708 5

If you want a leading zero on the day, use: '%Y%m%d'


--
Just my 0.00000002 million dollars worth,
Shawn

"For the things we have to learn before we can do them, we learn by doing them."
Aristotle
 
S

Skye Shaw!@#$

Strange, both of them should be: 200708 5

strftime(3) says that the %e format flag is part of the Single Unix
Specification.

Maybe %e is possible on Windows, depending on your systems service
packs/installs and the level of POSIX compliance they add.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top