[Techtalk] Simple date question

Lisa Kachold lisakachold at obnosis.com
Mon Oct 7 13:10:08 UTC 2013


Set Time Zone:

Ubuntu/debian  http://manpages.ubuntu.com/manpages/dappe<http://manpages.ubuntu.com/manpages/dapper/man8/tzconfig.8.html>
r/man8/tzconfig.8.html<http://manpages.ubuntu.com/manpages/dapper/man8/tzconfig.8.html>
"tzconfig" or "dpkg-reconfigure tzdata"

CentOs/Redhat http://www.cyberciti.biz/faq/howto-linux-unix-change-s  "setup"
or "redhat-config-date" (you can also just symlink to the right zone)

Once you have set the correct time zone, your date +%Z will display
correctly.

On Mon, Oct 7, 2013 at 12:35 AM, <mgmonza at sdf.lonestar.org> wrote:

> Hi, all,
>
> This has been a typical linux time sponge for me.  I've been trying for
> far too many hours, reading man pages, duckduckgo'ing, etc, to simply set
> the time zone using the date command.
>
> Does anyone know that this CAN'T be done?  It would save me much time to
> know this too, but that most inscrutable of man pages seems to say it can.
>
> From the DATE man page:
>  %Z     alphabetic time zone abbreviation (e.g., EDT)
>  %z     +hhmm numeric timezone (e.g., -0400)
>
> This was typical of the hundreds of trys I've done, and it did't work:
>
> sudo date -s +%Z --EDT
>
> All I'm interested is setting this via the command line, either with date
> or some other one-liner that can be put into my .bashrc. My main laptop
> died a month ago and all I've got now is my old XP laptop filled to the max
> with work stuff I'll need if I ever find a computer job again. There's no
> room for even the barest of Linuxes, so I've been using a live Ubuntu CD
> and copying over the minimum necessary to just use it as a linux box. Most
> of my aliases take care of making a storage unit look like my lost home,
> but time thing got me.
>
> This is my time alias, necessary because the disk sets the wrong time:
>
> alias settime="sudo date '+%l:%M %p' -s \$1"
>
> and works like this:
>
> settime 3:41am
>
> I'd just like that last tweak that sets it to EDT.
>
> Thanks!
>
> MG
> ______________________________**_________________
> Techtalk mailing list
> Techtalk at linuxchix.org
> http://mailman.linuxchix.org/**mailman/listinfo/techtalk<http://mailman.linuxchix.org/mailman/listinfo/techtalk>
>



-- 

(503) 754-4452 Android
(623) 239-3392 Skype
(623) 688-3392 Google Voice
**
it-clowns.com <http://it-clowns.com/c/>
Chief Clown


More information about the Techtalk mailing list