Change the clock format from 12 hour to 24 hour - Puppy 4

Using applications, configuring, problems
Post Reply
Message
Author
User avatar
DreamsToGo
Posts: 118
Joined: Fri 27 Jan 2006, 08:28
Location: Castelnaudary, south France, World Capital of Cassoulet

Change the clock format from 12 hour to 24 hour - Puppy 4

#1 Post by DreamsToGo »

Hello All,

I have written a script to change the time format of the JWM clock from 12 hour to 24 hour formats and vice versa. It is called "clocktype".

I have also changed the JWMConfig tray applet to be able to call the clock script.

You can download these from the attachments in the post.

I hope these will be useful to you.

Put both these files into /usr/local/jwmconfig2

Barry, could you install these as standard in Puppy? I would really appreciate it - most people in Europe use the 24 hour clock. Thanks

Hilary
Attachments
ChangeClockType.tar.gz
Change clock display format and integrate to existing tray manager.
After download, unpack to /usr/local/jwmconfig2
(1.57 KiB) Downloaded 1175 times
Last edited by DreamsToGo on Sat 10 May 2008, 12:52, edited 2 times in total.

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#2 Post by HairyWill »

works for me, how about augmenting it to give a few more options.
You could include options that allow the day and/or date as well
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
DreamsToGo
Posts: 118
Joined: Fri 27 Jan 2006, 08:28
Location: Castelnaudary, south France, World Capital of Cassoulet

#3 Post by DreamsToGo »

Will, thanks for the suggestions, I'll have a go at putting these options in, although, I have to say that clocktype was my first attempt at a script! and I relied heavily on existing scripts already in Puppy. But that's the way we all learn, isn't it?

Hilary

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#4 Post by HairyWill »

Hilary,
Your scripting is a lot neater and easier to follow than mine! I presume you have found all the list of allowable formatters by searching for strftime
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
DreamsToGo
Posts: 118
Joined: Fri 27 Jan 2006, 08:28
Location: Castelnaudary, south France, World Capital of Cassoulet

#5 Post by DreamsToGo »

Will, thanks for the compliment.

No, I haven't found all the available options, I was just starting the search; any pointers would be welcome.

Hilary

User avatar
DreamsToGo
Posts: 118
Joined: Fri 27 Jan 2006, 08:28
Location: Castelnaudary, south France, World Capital of Cassoulet

#6 Post by DreamsToGo »

Well, I found the available options in strftime(3) as suggested by Will and as found in the JWM configuration page, and there are lots of them!

Before starting to code, what options would be appropriate? I start with,

1) 12 hour or 24 hour clock
2) show date and day, ie Saturday May 10 or just the date with no day.

Any others?

dptxp
Posts: 34
Joined: Wed 12 Sep 2007, 05:19

#7 Post by dptxp »

Defaults -

24 hours format, preferably with seconds.
Day included with Date - Sat 10th May 2008.

My opinion.
[url]http://linux.ixcodes.com[/url]

User avatar
DreamsToGo
Posts: 118
Joined: Fri 27 Jan 2006, 08:28
Location: Castelnaudary, south France, World Capital of Cassoulet

#8 Post by DreamsToGo »

If you float the cursor over the time in the taskbar, you get a yellow popup showing the day, date, time and year.

I'm asking myself why take up taskbar real estate with the day and date when it is already available on demand?

Given this, I am not going to change the clocktype script.

Hilary

User avatar
Scoticus
Posts: 443
Joined: Mon 01 Jan 2007, 19:47
Location: Erskine, Scotland

Change the clock format from 12 hour to 24 hour - Puppy 4

#9 Post by Scoticus »

DreamsToGo

Many thanks for all your good work. I was getting to like banging my head against a brick wall. You have saved a life.

So much frustration over such a minor difference in format.

Could I suggest that a moderator set this as a sticky as no doubt there are many more that I looking for a resolution to this problem. Perhaps they might also give Barry a heads up on it also

Once again thanks vm

User avatar
Monson
Posts: 28
Joined: Sun 25 May 2008, 15:58
Location: Germany
Contact:

#10 Post by Monson »

Hello to all,

yes, me for example. This is one of the questions I've been asking myself and would have asked ASAP, after a few others.

Make it easy to find.

Bye,

Monson.
[b]DE[/b]:Wer nicht wa:hlt, hat nichts zu melden/maulen. [b]EN[/b]:Those not voting have nothing to say/moan about.
Puppy 4.21; CD2HDD; AMD64 & X86. Slow: Laptop x86-PI@133MHz-64mb RAM (modded Puppy); Fast:Laptop AMD64X2@2.2GHz-4gb RAM.

User avatar
Artie
Posts: 448
Joined: Tue 04 Oct 2005, 17:45
Location: Norway
Contact:

#11 Post by Artie »

I have installed your script in 4.1.1 but how exactly do I change from 12 to 24 hour format?

Artie

User avatar
Monson
Posts: 28
Joined: Sun 25 May 2008, 15:58
Location: Germany
Contact:

#12 Post by Monson »

Hi there,

well, I didn't need to install any scripts to change the format.

My version of puppy is 4.00 Dingo, installed the CD-Version to HDD.

Goto your root dir, i.e.
/root #

and edit file ".jwmrc-tray" (without the quotes, notice the leading dot)

and change your CLOCK line to the following:

<Clock format="%H:%M:%S">minixcal</Clock>

That's all there was to it for me on two different systems.

Hope it helps you.

Bye, Monson
[b]DE[/b]:Wer nicht wa:hlt, hat nichts zu melden/maulen. [b]EN[/b]:Those not voting have nothing to say/moan about.
Puppy 4.21; CD2HDD; AMD64 & X86. Slow: Laptop x86-PI@133MHz-64mb RAM (modded Puppy); Fast:Laptop AMD64X2@2.2GHz-4gb RAM.

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#13 Post by Béèm »

If you don't want the seconds it can be like:

Code: Select all

<Clock format="%R">minixcal</Clock> 
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

User avatar
`f00
Posts: 807
Joined: Thu 06 Nov 2008, 19:13
Location: the Western Reserve

#14 Post by `f00 »

Yep, that works as long as you have a jwmrc_tray (%T for 24hr w/seconds, but be sure to use a mono font and check it .. otherwise it can 'bump' the tray components in a distracting manner). Tooltip I like to have as two-digit ymd (following the greater-to-lesser timespan logic of the normal clock) with a full dayname following - putting the time in a tooltip seems needless if it's there on the tray already (unless you use it for inputting a time-ref). Some wm's I haven't quite found where to config the time format to my liking (not to mention tooltips), usually it's conky to the rescue then as it seems to work consistently in most situations even when there is no tray :)

Offhand, is there a strftime notation for internetime (aka 'swatch' where the day is divided by 1000 parts), I find it handy for an unambiguous short reference of world time (no offsets, etc) - TClockEx in win32 gives me that in a tooltip @442

User avatar
CatDude
Posts: 1563
Joined: Wed 03 Jan 2007, 17:49
Location: UK

#15 Post by CatDude »

Hi

If you are using IceWM

1. Open Rox-Filer
2. Make sure show hidden files is enabled (click on the eye)
3. Go to /root/.icewm
4. Right click on preferences file, select Open As Text.
5. Search for: TimeFormat=
  • For 24 Hour Clock (showing seconds)
    use: TimeFormat="%H:%M:%S"
6. Make sure you remove the "#" at the beginning of the line.
7. Restart IceWM by going to menu -> Shutdown -> Retstart IceWM

You can find more info here: IceWM FAQ's

CatDude
.
[img]http://www.smokey01.com/CatDude/.temp/sigs/acer-futile.gif[/img]

Post Reply