LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 06-27-2019, 12:27 PM   #1
Andy Alt
Member
 
Registered: Jun 2004
Location: Minnesota, USA
Distribution: Slackware64-stable, Manjaro, Debian64 stable
Posts: 528

Rep: Reputation: 167Reputation: 167
UTC string shows "PM UTC"


On Debian 10, I tried changing my system time from CDT to UTC using

'ln -sf /usr/share/zoneinfo/UTC localtime'

but the output from "date" now shows "Thu 27 Jun 2019 05:13:34 PM UTC"

Here's what I tried to fix it:

Code:
root@oceanus:/home/andy# timedatectl set-timezone UTC

root@oceanus:/home/andy# date
Thu 27 Jun 2019 05:17:31 PM UTC

root@oceanus:/home/andy# timedatectl set-local-rtc 0

root@oceanus:/home/andy# date
Thu 27 Jun 2019 05:20:39 PM UTC

root@oceanus:/home/andy# timedatectl | grep local
          RTC in local TZ: no

root@oceanus:/home/andy# date
Thu 27 Jun 2019 05:20:56 PM UTC

root@oceanus:/home/andy# timedatectl set-time "2019-06-27 17:27:53"

root@oceanus:/home/andy# date
Thu 27 Jun 2019 05:27:54 PM UTC

Last edited by Andy Alt; 06-27-2019 at 12:28 PM. Reason: formatting
 
Old 06-27-2019, 12:36 PM   #2
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
What's the issue? From your posting time and the time shown that looks like the time zone is UTC. I typed thios at around 17:35/5:35 PM UTC.
 
1 members found this post helpful.
Old 06-27-2019, 12:43 PM   #3
Andy Alt
Member
 
Registered: Jun 2004
Location: Minnesota, USA
Distribution: Slackware64-stable, Manjaro, Debian64 stable
Posts: 528

Original Poster
Rep: Reputation: 167Reputation: 167
Oh.. I didn't think it was normal or needed for "PM" to appear in a UTC date string.
 
Old 06-27-2019, 12:46 PM   #4
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
I mauy be wrong because I haven't read the man pages but I thibk that the time format would be controlled independantly of the time zone. I know when I install OSs I'm given the choice of 12 or 24 hour time (I rememeber this because I'm a 24 hour fan myself).
 
1 members found this post helpful.
Old 06-27-2019, 12:55 PM   #5
Andy Alt
Member
 
Registered: Jun 2004
Location: Minnesota, USA
Distribution: Slackware64-stable, Manjaro, Debian64 stable
Posts: 528

Original Poster
Rep: Reputation: 167Reputation: 167
@273 thanks. The main reason I asked was because I thought it might be affecting this issue with the rmw project I'm trying to troubleshoot. Apparently not the case (time for me to review the code).
 
Old 06-27-2019, 01:00 PM   #6
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Ah, now, looks like your container may be 12 hours off (unless that's just an example?) Which would be an issue. Is there a "system time set to UTC" option for Docker? Sorry, getting above my head here.
 
1 members found this post helpful.
Old 06-27-2019, 01:06 PM   #7
Andy Alt
Member
 
Registered: Jun 2004
Location: Minnesota, USA
Distribution: Slackware64-stable, Manjaro, Debian64 stable
Posts: 528

Original Poster
Rep: Reputation: 167Reputation: 167
Quote:
Originally Posted by 273 View Post
Ah, now, looks like your container may be 12 hours off (unless that's just an example?) Which would be an issue. Is there a "system time set to UTC" option for Docker? Sorry, getting above my head here.
Yeah, an example after some rushed copying and pasting. I just now edited that particular post in the ticket to be more accurate.

Last edited by Andy Alt; 06-27-2019 at 01:07 PM. Reason: even more accuracy
 
Old 06-27-2019, 01:09 PM   #8
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Ah, no problem then, just formating. Might be worth trying to find out whether the program in question reads the time wronmg though? Shouldn't matter but if it actually uses "date" rather than reading system time...
 
Old 06-27-2019, 04:26 PM   #9
Andy Alt
Member
 
Registered: Jun 2004
Location: Minnesota, USA
Distribution: Slackware64-stable, Manjaro, Debian64 stable
Posts: 528

Original Poster
Rep: Reputation: 167Reputation: 167
Quote:
Originally Posted by 273 View Post
Ah, no problem then, just formating. Might be worth trying to find out whether the program in question reads the time wronmg though? Shouldn't matter but if it actually uses "date" rather than reading system time...
formatting was ok, just had an uninitialized pointer to a time struct. Fixed.
 
1 members found this post helpful.
Old 06-28-2019, 07:58 AM   #10
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Cool, glad you got it working.
 
1 members found this post helpful.
  


Reply

Tags
date, time, timedatectl



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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Centos7, invalid offset for UTC for Sweden, says UTC+00 Basher52 CentOS 14 02-09-2018 10:10 PM
Lubuntu 15.04 "error: invalid string constant "thunar-statusbar", expected valid string constant" error knobby67 Ubuntu 1 12-09-2016 12:19 AM
[SOLVED] Replace a string @CURRANGE("***","***") to @CURRANGE("xxx","xxx") in a file mavadikarmayur Linux - Newbie 3 03-26-2012 08:32 AM
baselayout2 -`date` shows UTC althrough I set CLOCK="local"? quanta Gentoo 0 01-11-2011 01:08 AM
Help With Java Problem Please"""""""""""" suemcholan Linux - Newbie 1 04-02-2008 06:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 07:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration