perl - strftime '%z', (localtime) is not working as expected in solaris machines -


i tried code in linux machines,

my $sysdate = strftime "%y%m%d%t", (localtime);     $daylight_saving_time = strftime '%z', (localtime); 

i below output,

sysdate = 2013051402:12:02     daylight_saving_time = -0400 

i tried same in solaries machines, got

sysdate = 2013051402:12:02 daylight_saving_time = %z 

anyone know change done daylight saving in solaries machines.

thanks in advance.

the issue posix::strftime calls system's strftime(3), whatever - or - not. %z not part of posix.1 standard , not consistent across systems. on other older versions of oses, hpux, %z, same %z (time zone name). older versions.

on solaris 8, 9 strftime not support %z - solaris 10 does.

this holds on more moderns versions solaris 10 & solaris 11:

%z replaced offset utc in iso 8601:2000 standard format (+hhmm or -hhmm), or no characters if no time zone deter- minable. example, "-0430" means 4 hours 30 minutes behind utc (west of greenwich). if tm_isdst zero, standard time off- set used. if tm_isdst greater zero, daylight sav- ings time offset if used. if tm_isdst negative, no characters returned.

so, c library function issue, perl sits on top of libraries. not have workaround.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -