Choose style:

Author Topic: XFCE Clock - Custom formatting codes  (Read 2823 times)

0 Members and 1 Guest are viewing this topic.

Offline VinDSL

  • Global Moderator
  • Hero
  • *****
  • Posts: 4180
  • Karma: 785
  • Peppermint Mod
    • View Profile
XFCE Clock - Custom formatting codes
« on: November 16, 2016, 06:05:27 pm »
Special thanks to Erik_FL @ LinuxQuestions.org


This information is a little difficult to find and not in the XFCE help (as far as I know). Here are the formatting codes that can be used when setting the XFCE Clock (on the panel) to use a Custom format. Type the codes in the text box along with any other literal text that you want displayed such as colons, periods, etc.

Quote
%%   a literal %
%a   locale's abbreviated weekday name (e.g., Sun)
%A   locale's full weekday name (e.g., Sunday)
%b   locale's abbreviated month name (e.g., Jan)
%B   locale's full month name (e.g., January)
%c   locale's date and time (e.g., Thu Mar  3 23:05:25 2005)
%C   century; like %Y, except omit last two digits (e.g., 21)
%d   day of month (e.g, 01)
%D   date; same as %m/%d/%y
%e   day of month, space padded; same as %_d
%F   full date; same as %Y-%m-%d
%g   last two digits of year of ISO week number (see %G)
%G   year of ISO week number (see %V); normally useful only with %V
%h   same as %b
%H   hour (00..23)
%I   hour (01..12)
%j   day of year (001..366)
%k   hour ( 0..23)
%l   hour ( 1..12)
%m   month (01..12)
%M   minute (00..59)
%n   a newline
%p   locale's equivalent of either AM or PM; blank if not known
%P   like %p, but lower case
%r   locale's 12-hour clock time (e.g., 11:11:04 PM)
%R   24-hour hour and minute; same as %H:%M
%s   seconds since 1970-01-01 00:00:00 UTC
%S   second (00..60)
%t   a tab
%T   time; same as %H:%M:%S
%u   day of week (1..7); 1 is Monday
%U   week number of year, with Sunday as first day of week (00..53)
%V   ISO week number, with Monday as first day of week (01..53)
%w   day of week (0..6); 0 is Sunday
%W   week number of year, with Monday as first day of week (00..53)
%x   locale's date representation (e.g., 12/31/99)
%X   locale's time representation (e.g., 23:13:48)
%y   last two digits of year (00..99)
%Y   year
%z   +hhmm numeric timezone (e.g., -0400)
%Z   alphabetic time zone abbreviation (e.g., EDT)


As an example, I entered this for my Custom clock format:

  • %l:%M %p

That's a lower case "L" not a capital "i". The resulting time display looks like this:

  • 8:44 PM

Offline perknh

  • Trusted User
  • Hero
  • *****
  • Posts: 3417
  • Karma: 269
  • Soy un huevo que adora Peppermint.
    • View Profile
  • Peppermint version(s): Peppermint 9 (64-bit)
Re: XFCE Clock - Custom formatting codes
« Reply #1 on: November 16, 2016, 06:41:23 pm »
Thank you, VinDSL.  This is helpful.  :)
We're all Peppermint users and that's what matters  ;). -- AndyInMokum

Offline scifidude79

  • Global Moderator
  • Hero
  • *****
  • Posts: 3452
  • Karma: 776
    • View Profile
  • Peppermint version(s): Peppermint 7 & 9
Re: XFCE Clock - Custom formatting codes
« Reply #2 on: November 16, 2016, 07:12:50 pm »
Nice tutorial.  I remember having to look up this information we I first started using Peppermint, so this tutorial will definitely come in handy for new people seeking this information.  :)

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 22026
  • Karma: 2470
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R and 9
Re: XFCE Clock - Custom formatting codes
« Reply #3 on: November 16, 2016, 07:55:51 pm »
See:
Code: [Select]
man strftime
;)
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline VinDSL

  • Global Moderator
  • Hero
  • *****
  • Posts: 4180
  • Karma: 785
  • Peppermint Mod
    • View Profile
Re: XFCE Clock - Custom formatting codes
« Reply #4 on: November 16, 2016, 08:42:33 pm »
SSSSShhhhhh !   ;D

Offline perknh

  • Trusted User
  • Hero
  • *****
  • Posts: 3417
  • Karma: 269
  • Soy un huevo que adora Peppermint.
    • View Profile
  • Peppermint version(s): Peppermint 9 (64-bit)
Re: XFCE Clock - Custom formatting codes
« Reply #5 on: November 16, 2016, 09:03:59 pm »
Good one, guys.  Peppermint forum keeps us on our toes!  ;)

My next stage in my Linux education will be to learn about manual pages.  I know so little about them.
We're all Peppermint users and that's what matters  ;). -- AndyInMokum

Offline zebedeeboss

  • Global Moderator
  • Hero
  • *****
  • Posts: 2549
  • Karma: 500
  • Life first... Peppermint a close 2nd :)
    • View Profile
  • Peppermint version(s): Peppermint 9 x64
Re: XFCE Clock - Custom formatting codes
« Reply #6 on: November 16, 2016, 09:47:21 pm »
Hi All

I always used this site...

http://www.foragoodstrftime.com/

Regards Zeb...
Be Kind Whenever Possible...   It is Always Possible - Dalai Lama

Linux User #565092
P9 x64 Desktop - i7-6700K @ 4.00GHz - 32Gb RAM - NVIDIA GTX1070ti 8Gb - 2 x 27" 4k 3840x2160 - 1 x 34" 3440 x 1440
x64 Laptop - i7-7700HQ @ 2.80GHz - 8Gb RAM - Nvidia GTX1050 4Gb - 15.6" HD 1920x1080

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 22026
  • Karma: 2470
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R and 9
Re: XFCE Clock - Custom formatting codes
« Reply #7 on: November 17, 2016, 06:36:02 am »
That's a pretty handy site Zeb :)
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline mracz

  • Jr. Member
  • **
  • Posts: 61
  • Karma: 1
  • New Forum User
    • View Profile
  • Peppermint version(s): 7
Re: XFCE Clock - Custom formatting codes
« Reply #8 on: November 19, 2016, 03:39:23 am »
To give some colors to your precious time

Code: [Select]
<span foreground="white">%R</span>%n<span foreground="white">%m-%d</span>

Copy this to Clock options format in panel settings.

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 22026
  • Karma: 2470
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R and 9
Re: XFCE Clock - Custom formatting codes
« Reply #9 on: November 19, 2016, 10:08:42 am »
Or even change the font
Code: [Select]
<span foreground="#F7E0E1" font_desc="vibrocentric bold italic 13">%R </span>
or
Code: [Select]
<span foreground="#F7E0E1" font_desc="vibrocentric bold italic 13">%R </span>  <span foreground="#F7E0E1" font_desc="vibrocentric bold italic 13">%d %b</span>
(for all of us that don't like the confusion caused by having our day/month backwards :D )
« Last Edit: November 19, 2016, 10:31:44 am by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline VinDSL

  • Global Moderator
  • Hero
  • *****
  • Posts: 4180
  • Karma: 785
  • Peppermint Mod
    • View Profile
Re: XFCE Clock - Custom formatting codes
« Reply #10 on: November 19, 2016, 11:02:05 am »
Oh, my !   :o

I didn't realize XFCE4 was using Pango for markup in the panel.  Nicceee !

Once again, the gift that keeps on giving ...

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 22026
  • Karma: 2470
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R and 9
Re: XFCE Clock - Custom formatting codes
« Reply #11 on: November 19, 2016, 11:04:09 am »
:) Zactly
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline VinDSL

  • Global Moderator
  • Hero
  • *****
  • Posts: 4180
  • Karma: 785
  • Peppermint Mod
    • View Profile
Re: XFCE Clock - Custom formatting codes
« Reply #12 on: April 14, 2018, 11:54:31 pm »
UPDATE

Been using these settings for awhile - might as well document them:

Appearance
    Layout: Digital
    Tooltip Format: Custom Format
Code: [Select]
%A, %B %d, %Y

Clock Options
    Format: Custom Format
Code: [Select]
<span foreground="#F7E0E1" font_desc="11.3">%l:%M:%S %p</span>

Offline stevesveryown

  • Member
  • ***
  • Posts: 136
  • Karma: 27
  • Peppermint Fan
    • View Profile
    • stevesveryown
  • Peppermint version(s): Peppermint 8 & Peppermint 9
Re: XFCE Clock - Custom formatting codes
« Reply #13 on: April 15, 2018, 09:36:52 am »
Amazing how the simple things in life keep us happy.  :)
I'll have to play around with some of the sweet suggestions here.

In the meantime, I do mine:
Code: [Select]
%A, %B %d, %Y @ %l:%M %p

I have 3 panels at my top and the clock is in the middle panel with my weather update right next to it.
« Last Edit: April 15, 2018, 09:39:05 am by stevesveryown »
Thanks!

Steve

My main machine:
AMD FX-8320 Piledriver (Vishera) 3.5GHz (4.1GHz turbo) (Eight Core) AM3+ 8MB Cache
AMD Black Edition Copper HeatPipe EXTRA QUIET fan
NVIDIA GeForce GT 730
ASUS SABERTOOTH 990FX AM3+, SLI & Cross Fire, SATA3, USB 3.0
16GB (2x8GB) PC17000 DDR3 2133 Dual Channel (high

Offline mac

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1088
  • Karma: 335
    • View Profile
  • Peppermint version(s): Peppermint 7-8-9
Re: XFCE Clock - Custom formatting codes
« Reply #14 on: May 10, 2018, 11:06:33 pm »
A belated thanks, Vin.   ;)
Peppermint: Standing Out from the Cloud
Reg. Linux User #432835