#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Posts
    9
    Rep Power
    0

    Difference in Date


    Hi All,

    I have this strange scenario.

    Code:
    [root@server 1]# perl -MTime::ParseDate -e 'printf "%s\n", &parsedate("2012-10-25 10:28:41")'
    This gives the answer as : 1351178921

    Code:
    [root@server 1]# perl -MTime::Format -e 'printf "%s\n", $time{'yyyymmdd_hhmmss',1351178921}'
    This Gives the asnwer as : 20121025_102841 ( This is correct as expected )

    But when i run the same code in another server it gives out different result for Time::Format

    Code:
    [root@server 2]# perl -MTime::Format -e 'printf "%s\n", $time{'yyyymmdd_hhmmss',1351178921}'
    This Gives the asnwer as : 20121025_102817 ( Wrong answer)

    I dont understand why we have a difference of ~24 sec between the result created in these two server ....they are using the same version of perl module and all configuration are similar.

    The only differnce i notice that the System Time between both server varies by ~24 seconds.So my question is dose Time::Format consider the SYSTEM TIME for conversion....are they related ?

    Sserver 1 : Result for date Command
    Tue Nov 6 01:18:15 EST 2012

    Server 2 : Result for date Command
    Tue Nov 6 01:17:51 EST 2012

    Any suggestion on what causing this issue ?

    Regards
    Ashesh
  2. #2
  3. 'fie' on me, allege-dly
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2003
    Location
    in da kitchen ...
    Posts
    12,889
    Rep Power
    6444
    I'd ask the developer Eric J. Roode, you'll find his contact details on the Time::Format page on CPAN

    You could just look through the code and see what's what ...

    ~24 seconds being the difference in server time and the difference in output, looks a bit convincing for use of the system time all the same
    --Ax
    without exception, there is no rule ...
    Handmade Irish Jewellery
    Targeted Advertising Cookie Optout (TACO) extension for Firefox
    The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones


    09 F9 11 02
    9D 74 E3 5B
    D8 41 56 C5
    63 56 88 C0
    Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.
    -- Jamie Zawinski
    Detavil - the devil is in the detail, allegedly, and I use the term advisedly, allegedly ... oh, no, wait I did ...
    BIT COINS ANYONE
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Posts
    9
    Rep Power
    0
    Originally Posted by Axweildr
    I'd ask the developer Eric J. Roode, you'll find his contact details on the Time::Format page on CPAN

    You could just look through the code and see what's what ...

    ~24 seconds being the difference in server time and the difference in output, looks a bit convincing for use of the system time all the same
    Hi Axweildr,

    Thanks for the info,
    But i have tried this code in two different server ( with a time differnce of 25+ sec) but both gives the same outout for Time::Format piece of code.

    So i believe the ~24sec gap between the server may not be the real reason for above said issue ....

    Regards
    Ashesh
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2012
    Posts
    833
    Rep Power
    496
    My impression is that it would not make any sense for the module to use the current system date to achieve conversion of dates passed to it. The 24 second difference between the two server could shed some doubt on this impression, but I still can't believe it.

    Having said that, I have no idea as to why it should give different results on different servers, especially if it is the same version of the module.

    I'll give a try on the various servers on which I have access.

IMN logo majestic logo threadwatch logo seochat tools logo