Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 6th, 2012, 12:21 AM
asheshrocky asheshrocky is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 9 asheshrocky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 15 m 58 sec
Reputation 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

Reply With Quote
  #2  
Old November 6th, 2012, 05:31 AM
Axweildr's Avatar
Axweildr Axweildr is offline
'fie' on me, allege-dly
Click here for more information.
 
Join Date: Mar 2003
Location: in da kitchen ...
Posts: 12,874 Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)  Folding Points: 162285 Folding Title: Super Ultimate Folder - Level 1Folding Points: 162285 Folding Title: Super Ultimate Folder - Level 1Folding Points: 162285 Folding Title: Super Ultimate Folder - Level 1Folding Points: 162285 Folding Title: Super Ultimate Folder - Level 1Folding Points: 162285 Folding Title: Super Ultimate Folder - Level 1Folding Points: 162285 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 4 Months 2 Weeks 1 Day 20 h 28 m 56 sec
Reputation Power: 6421
Send a message via Google Talk to Axweildr
Orkut
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

Reply With Quote
  #3  
Old November 6th, 2012, 06:43 PM
asheshrocky asheshrocky is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 9 asheshrocky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 15 m 58 sec
Reputation Power: 0
Quote:
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

Reply With Quote
  #4  
Old November 7th, 2012, 01:13 AM
Laurent_R Laurent_R is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2012
Posts: 502 Laurent_R User rank is Major (30000 - 40000 Reputation Level)Laurent_R User rank is Major (30000 - 40000 Reputation Level)Laurent_R User rank is Major (30000 - 40000 Reputation Level)Laurent_R User rank is Major (30000 - 40000 Reputation Level)Laurent_R User rank is Major (30000 - 40000 Reputation Level)Laurent_R User rank is Major (30000 - 40000 Reputation Level)Laurent_R User rank is Major (30000 - 40000 Reputation Level)Laurent_R User rank is Major (30000 - 40000 Reputation Level)Laurent_R User rank is Major (30000 - 40000 Reputation Level)Laurent_R User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 4 Days 18 h 51 m 13 sec
Reputation Power: 385
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Difference in Date

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap