View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 7 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Wed Dec 27, 2006 5:02 am 
Offline
Joined: Wed Apr 28, 2004 10:42 pm
Posts: 405
Location: Bendigo, Victoria, Australia
I am trying to setup the automatic wakeup stuff but am having some trouble getting the times correct.

The date -u command gives me the time offset by five hours forward instead of 11 back.

If I'm only after the current time it works fine:
Code:
root@mythtv:/home/mythtv# date +%T\ %z
21:59:40 +1100
root@mythtv:/home/mythtv# date +%T\ %z -u
10:59:50 +0000



But if I'm trying to specify a time it is offset by the wrong amount:
Code:
root@mythtv:/home/mythtv# date -d "01:23 EST" +%T\ %z
01:23:00 +1100
root@mythtv:/home/mythtv# date -d "01:23 EST" -u +%T\ %z
06:23:00 +0000


Any ideas?

_________________
Paul Turpie
-------------
<--Is your location in your profile? Why not?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 27, 2006 7:56 am 
Offline
Joined: Tue Apr 13, 2004 6:51 pm
Posts: 890
Location: Groton, MA
hmm, seems to be working for me...

It is almost 9:00 AM here in EST
Code:
root@mythtv:~# date  +"%T %z"
08:52:35 -0500

If I want the time of 12:01 PM in PST (displayed in my timezone) it correctly shows 3:01 PM
Code:
date -d "12:01 PST" +"%T %z"
15:01:00 -0500

which is 8:01 PM in greenwich
Code:
 date -d "12:01 PST" +"%T %z" -u
20:01:00 +0000


What exactly are you trying to do?

_________________
R5F1 - Dell P4 2.4Ghz 500MB - PVR250 x 2 - GeForce FX 5200 - Onboard sound/NIC 80GB ATA/250GB ATA/400GB SATA


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 27, 2006 9:02 pm 
Offline
Joined: Wed Apr 28, 2004 10:42 pm
Posts: 405
Location: Bendigo, Victoria, Australia
khrusher wrote:
What exactly are you trying to do?

I'm trying to get ACPI Wakeups working.

I can get the machine to wake up automatically but because the hardware clock runs in UTC time I need to convert from the local time before setting the wakeup alarm. If I try to get it to wake up at 06:00 it will instead wake up at 17:00.

_________________
Paul Turpie
-------------
<--Is your location in your profile? Why not?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 27, 2006 9:13 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
Code:
root@black2:~# date
Wed Dec 27 22:12:43 EST 2006
root@black2:~# TZ=GMT date
Thu Dec 28 03:12:44 GMT 2006


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 27, 2006 9:42 pm 
Offline
Joined: Wed Apr 28, 2004 10:42 pm
Posts: 405
Location: Bendigo, Victoria, Australia
After seeing that you guys are both in MA in the USA I've realised that EST is an ambiguous abbreviation. See here http://www.timeanddate.com/library/abbr ... timezones/

The bash script in the mythtv wiki ACPI Wakeup article used the following line.
Code:
datum=$(/bin/date -f $stamp_file +%F\ %T\ %Z)


I have changed the %Z to %z and it now gives the correct time.
Code:
datum=$(/bin/date -f $stamp_file +%F\ %T\ %z)


I will update the wiki soon.

_________________
Paul Turpie
-------------
<--Is your location in your profile? Why not?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 25, 2007 11:36 am 
Offline
Joined: Wed Dec 13, 2006 4:29 pm
Posts: 42
I'm sure this has an obvious answer, but where do we 'put' that script that corrects for the timezone difference? When should it get called?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 25, 2007 5:35 pm 
Offline
Joined: Wed Apr 28, 2004 10:42 pm
Posts: 405
Location: Bendigo, Victoria, Australia
richwine4 wrote:
I'm sure this has an obvious answer, but where do we 'put' that script that corrects for the timezone difference? When should it get called?

Are you trying to use ACPI wakeups?

I ended up using tohc1's script instead which I also had to modify slightly. http://mysettopbox.tv/phpBB2/viewtopic. ... highlight=

He puts the script in /usr/bin/setwakeup.sh but I on my system I put it in /home/mythtv/setwakeup.sh because files in the mythtv home directory will be backed up and kept when I autoupgrade to the next version of Knoppmyth. Upgrading will only keep certain directories and the rest is wiped.

_________________
Paul Turpie
-------------
<--Is your location in your profile? Why not?


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu