Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: UTC and localtime

  1. #1

    Default UTC and localtime

    Hi Guys,
    I'm running openSuSE 12.1 and my local time and UTC are reversed, That is when I enter <hwclock --localtime> it displays GMT, and when I enter <hwclock --utc> it displays my local time. My time zone is America/New_York, and this is set correctly. I set my desktop clock to my local time and my /etc/sysconfig/clock file shows the directive <HWCLOCK ="--localtime>. I should mention that I am running this os out of VirtualBox. However, my host os, Trisquel 5.5, has the same problem, so the fault is probably not with VirtualBox. Does anyone have any ideas on how to fix this problem. I've tried everything in my CompTIA Linux+ textbook to no avail. Thanks for your help.
    Mike

  2. #2
    Join Date
    Jul 2008
    Location
    Seattle, WA
    Posts
    17,043

    Default Re: UTC and localtime

    On Thu, 31 May 2012 19:36:02 +0000, murphy19804 wrote:

    > However, my host os, Trisquel 5.5, has the same problem, so the fault is
    > probably not with VirtualBox.


    I would fix it in the host. The guest is probably picking the issue up
    from the host, so start with the host.

    Does the host dual-boot Windows? One common issue is that Windows stores
    local time in the HW clock, and Linux prefers UTC.

    Jim

    --
    Jim Henderson
    openSUSE Forums Administrator
    Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

  3. #3
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: UTC and localtime

    On 2012-05-31 21:36, murphy19804 wrote:
    >
    > Hi Guys,
    > I'm running openSuSE 12.1 and my local time and UTC are reversed, That
    > is when I enter <hwclock --localtime> it displays GMT, and when I enter
    > <hwclock --utc> it displays my local time. My time zone is
    > America/New_York, and this is set correctly. I set my desktop clock to
    > my local time and my /etc/sysconfig/clock file shows the directive
    > <HWCLOCK ="--localtime>.


    Run "hwclock --debug", then "date" and post commands and output here, using
    code tags:

    Posting in Code
    Tags - A Guide



    > I should mention that I am running this os out
    > of VirtualBox. However, my host os, Trisquel 5.5, has the same problem,
    > so the fault is probably not with VirtualBox.


    I don't know what is "Trisquel", but assuming it is Linux do the same as above.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)

  4. #4

    Default Re: UTC and localtime

    Quote Originally Posted by hendersj View Post
    On Thu, 31 May 2012 19:36:02 +0000, murphy19804 wrote: > However, my host os, Trisquel 5.5, has the same problem, so the fault is > probably not with VirtualBox. I would fix it in the host. The guest is probably picking the issue up from the host, so start with the host. Does the host dual-boot Windows? One common issue is that Windows stores local time in the HW clock, and Linux prefers UTC. Jim -- Jim Henderson openSUSE Forums Administrator Forum Use Terms & Conditions at openSUSE Forums FAQ
    Thank you for your reply. I tried fixing it in the host, but I had no more luck than in the guest. Also, I don't dual-boot, so there should not be a local time vs UTC conflict. However, this machine used to run windows, and, although I did a clean install to Linux is there any possibility of a hold over from the way windows handles the hwclock? Is that even possible? I wouldn't think so, but then you never know. Anyway, thanks again for your suggestion. Mike

  5. #5

    Default Re: UTC and localtime

    Quote Originally Posted by robin_listas View Post
    On 2012-05-31 21:36, murphy19804 wrote:
    >
    > Hi Guys,
    > I'm running openSuSE 12.1 and my local time and UTC are reversed, That
    > is when I enter <hwclock --localtime> it displays GMT, and when I enter
    > <hwclock --utc> it displays my local time. My time zone is
    > America/New_York, and this is set correctly. I set my desktop clock to
    > my local time and my /etc/sysconfig/clock file shows the directive
    > <HWCLOCK ="--localtime>.


    Run "hwclock --debug", then "date" and post commands and output here, using
    code tags:

    Posting in Code
    Tags - A Guide



    > I should mention that I am running this os out
    > of VirtualBox. However, my host os, Trisquel 5.5, has the same problem,
    > so the fault is probably not with VirtualBox.


    I don't know what is "Trisquel", but assuming it is Linux do the same as above.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)
    Thank you for your reply.
    Here is the code you requested.
    [CODEroot@mutts-desktop:~# hwclock --debug
    hwclock from util-linux 2.19.1
    Using /dev interface to clock.
    Last drift adjustment done at 1338412290 seconds after 1969
    Last calibration done at 1338412290 seconds after 1969
    Hardware clock is on local time
    Assuming hardware clock is kept in local time.
    Waiting for clock tick...
    ...got clock tick
    Time read from Hardware Clock: 2012/06/01 13:40:25
    Hw clock time : 2012/06/01 13:40:25 = 1338572425 seconds since 1969
    Fri 01 Jun 2012 01:40:25 PM EDT -0.244358 seconds
    root@mutts-desktop:~# date
    Fri Jun 1 09:40:53 EDT 2012
    root@mutts-desktop:~#
    ][/CODE]
    Thank you for your help.
    Mike

  6. #6
    Join Date
    Jul 2008
    Location
    Seattle, WA
    Posts
    17,043

    Default Re: UTC and localtime

    On Fri, 01 Jun 2012 13:36:02 +0000, murphy19804 wrote:

    > I tried fixing it in the host, but I had no more luck than in the guest.
    > Also, I don't dual-boot, so there should not be a local time vs UTC
    > conflict. However, this machine used to run windows, and, although I did
    > a clean install to Linux is there any possibility of a hold over from
    > the way windows handles the hwclock? Is that even possible? I wouldn't
    > think so, but then you never know. Anyway,
    > thanks again for your suggestion. Mike


    Try getting the time in the host set properly and then execute:

    hwclock --systohc

    That should set the HW clock to the system setting.

    You can also run hwclock on its own to see what time the clock says it is.

    Jim



    --
    Jim Henderson
    openSUSE Forums Administrator
    Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

  7. #7
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: UTC and localtime

    On 2012-06-01 15:46, murphy19804 wrote:

    >> I don't know what is "Trisquel", but assuming it is Linux do the same
    >> as above.


    This one you haven't answered.

    > Thank you for your reply.
    > Here is the code you requested.
    >
    > Code:
    > --------------------
    > root@mutts-desktop:~# hwclock --debug
    > hwclock from util-linux 2.19.1
    > Using /dev interface to clock.
    > Last drift adjustment done at 1338412290 seconds after 1969
    > Last calibration done at 1338412290 seconds after 1969
    > Hardware clock is on local time
    > Assuming hardware clock is kept in local time.
    > Waiting for clock tick...
    > ...got clock tick
    > Time read from Hardware Clock: 2012/06/01 13:40:25
    > Hw clock time : 2012/06/01 13:40:25 = 1338572425 seconds since 1969
    > Fri 01 Jun 2012 01:40:25 PM EDT -0.244358 seconds
    > root@mutts-desktop:~# date
    > Fri Jun 1 09:40:53 EDT 2012
    > root@mutts-desktop:~#
    >
    > --------------------


    Ok, your hardware clock is not set, and is running local time. You should
    set it to UTC, as you are not double-booting, and then sync it (after
    ensuring that the computer time as shown by "date" is correct).

    The command "hwclock --systohc" will copy the computer time to the hardware
    clock.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)

  8. #8

    Default Re: UTC and localtime

    Quote Originally Posted by hendersj View Post
    On Fri, 01 Jun 2012 13:36:02 +0000, murphy19804 wrote:

    > I tried fixing it in the host, but I had no more luck than in the guest.
    > Also, I don't dual-boot, so there should not be a local time vs UTC
    > conflict. However, this machine used to run windows, and, although I did
    > a clean install to Linux is there any possibility of a hold over from
    > the way windows handles the hwclock? Is that even possible? I wouldn't
    > think so, but then you never know. Anyway,
    > thanks again for your suggestion. Mike


    Try getting the time in the host set properly and then execute:

    hwclock --systohc

    That should set the HW clock to the system setting.

    You can also run hwclock on its own to see what time the clock says it is.

    Jim



    --
    Jim Henderson
    openSUSE Forums Administrator
    Forum Use Terms & Conditions at openSUSE Forums FAQ
    Thank you for your help. I'm all squared away. now.
    Mike

  9. #9

    Default Re: UTC and localtime

    Quote Originally Posted by robin_listas View Post
    On 2012-06-01 15:46, murphy19804 wrote:

    >> I don't know what is "Trisquel", but assuming it is Linux do the same
    >> as above.


    This one you haven't answered.

    > Thank you for your reply.
    > Here is the code you requested.
    >
    > Code:
    > --------------------
    > root@mutts-desktop:~# hwclock --debug
    > hwclock from util-linux 2.19.1
    > Using /dev interface to clock.
    > Last drift adjustment done at 1338412290 seconds after 1969
    > Last calibration done at 1338412290 seconds after 1969
    > Hardware clock is on local time
    > Assuming hardware clock is kept in local time.
    > Waiting for clock tick...
    > ...got clock tick
    > Time read from Hardware Clock: 2012/06/01 13:40:25
    > Hw clock time : 2012/06/01 13:40:25 = 1338572425 seconds since 1969
    > Fri 01 Jun 2012 01:40:25 PM EDT -0.244358 seconds
    > root@mutts-desktop:~# date
    > Fri Jun 1 09:40:53 EDT 2012
    > root@mutts-desktop:~#
    >
    > --------------------


    Ok, your hardware clock is not set, and is running local time. You should
    set it to UTC, as you are not double-booting, and then sync it (after
    ensuring that the computer time as shown by "date" is correct).

    The command "hwclock --systohc" will copy the computer time to the hardware
    clock.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)
    Trisquel is Linux and the code I copied above was generated by Trisquel. I followed the same procedure in openSuse 12 and got identical code, so I only posted the one. Anyway, thank you for your help. Things are working fine, now.
    Mike

  10. #10
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: UTC and localtime

    On 2012-06-01 21:16, murphy19804 wrote:
    >
    > Trisquel is Linux and the code I copied above is from it. openSuSE 12.1
    > generates the same code. However, I took your suggestions and am all
    > squared away now. Thank you.


    Ok :-)

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •