Solved

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

Posted on 2015-01-05
4
246 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 38

Accepted Solution

by:
Gerwin Jansen, EE MVE 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
In this post we will learn different types of Android Layout and some basics of an Android App.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
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.

738 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