Solved

Script "date" command returning one hour less than system time

Posted on 2015-01-05
4
236 Views
Last Modified: 2015-01-06
I have some script in unix that executes "date" command in it, its very weird, the "date" time returned by the script is one hour less than the same command executed directly on the system. What can be going on here??
0
Comment
Question by:celtician
4 Comments
 
LVL 24

Assisted Solution

by:mankowitz
mankowitz earned 166 total points
ID: 40532033
probably daylight savings time.
0
 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 167 total points
ID: 40532035
Which options/switches do you use for the "date" commands?

Does the script set or change the timezone?
Run "echo $TZ"  from the command line and from the script to check.
Contrast with "date +%z" run from the script and from the command line.
0
 
LVL 37

Accepted Solution

by:
Gerwin Jansen earned 167 total points
ID: 40532480
Without posting (parts of) your script that determine the date/time everything is possible,

TZ setting (environment or script), getting timestamp from a file (-r), excuting the date command on a remote machine etc.

Can you post your script or at least the parts that handle date/time?
0
 

Author Comment

by:celtician
ID: 40533567
Someone solved this issue at the office without telling how :S
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now