LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 09-07-2009, 07:45 PM   #1
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 793

Rep: Reputation: 245Reputation: 245Reputation: 245
XFCE Clock - Custom formatting codes


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.

Code:
%%   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
 
Old 09-07-2009, 09:13 PM   #2
abrouwers
Member
 
Registered: May 2005
Location: Michigan
Distribution: Slackware -current
Posts: 98

Rep: Reputation: 37
Hm, that's funny - these look VERY similar to my "man strftime" .
 
Old 09-07-2009, 09:16 PM   #3
eerok
Member
 
Registered: Nov 2005
Location: Canada
Distribution: Debian
Posts: 167

Rep: Reputation: 32
Or even the "man date" page ...

Even fancier date format help can be found with:
Code:
$ info coreutils 'date invocation'

Last edited by eerok; 09-07-2009 at 09:20 PM.
 
Old 09-08-2009, 12:06 AM   #4
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 793

Original Poster
Rep: Reputation: 245Reputation: 245Reputation: 245
Quote:
Originally Posted by abrouwers View Post
Hm, that's funny - these look VERY similar to my "man strftime" .
If that's true it would be nice for the XFCE help to have one sentence that says "Refer to ANSI C strftime() for the Custom Clock formatting codes". I'm a n00b to Linux and don't usually know what "everyone" knows. I did honestly try to find the information in the XFCE help and online. The place where I found the formatting information didn't mention "strftime()".
 
Old 09-08-2009, 02:32 AM   #5
eerok
Member
 
Registered: Nov 2005
Location: Canada
Distribution: Debian
Posts: 167

Rep: Reputation: 32
You're right. The Xfce docs should at least refer to where the information on Linux date formats can be found. This isn't Xfce information in particular ... it's general Linux stuff, which makes it harder to find in Xfce-centric searches.
 
Old 09-08-2009, 03:00 AM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,528
Blog Entries: 27

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by Erik_FL View Post
Here are the formatting codes that can be used when setting the XFCE Clock (on the panel) to use a Custom format.
Thank you for posting the information for the community's benefit (even if the *n*xperts already know what to do!)
 
Old 11-02-2009, 09:05 AM   #7
nwe2023
LQ Newbie
 
Registered: Nov 2006
Distribution: OpenSuse 11.3
Posts: 1

Rep: Reputation: 0
Eric, I just wanted to add my thanks. When I wanted to change the clock codes on my Slackware/Xfce laptop, all I knew was that I needed to know more about Xfce clock codes. So I did a Google search on "xfce clock codes". Give it a try; see what pops up as the first result. I certainly would never have known to look for a manual page on strftime, whatever that is. I think some of the most experienced Linux experts have forgotten how much they did not know when they first started using Linux. So thanks, and thanks to all the subject experts out there who have posted their expertise on this an other forums. We are completely MS-free at my small business, and it would not have been possible without this community.
 
Old 11-02-2009, 11:18 AM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,528
Blog Entries: 27

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by eerok View Post
You're right. The Xfce docs should at least refer to where the information on Linux date formats can be found. This isn't Xfce information in particular ... it's general Linux stuff, which makes it harder to find in Xfce-centric searches.
The xfce4-datetime-plugin (Orage clock) does say, in its configuration window, that it uses strftime and lists 10 commonly used strftime codes.

BTW, the Orage clock always shows the date whereas the standard Xfce clock only shows the date on mouse-over.
 
Old 11-09-2009, 09:03 PM   #9
vtel57
Member
 
Registered: Jul 2006
Location: Tampa, FL, USA
Distribution: Slackware64
Posts: 843

Rep: Reputation: 88
COPIED! Thank you!
 
Old 06-03-2012, 07:52 PM   #10
cmc
LQ Newbie
 
Registered: Jan 2008
Posts: 4

Rep: Reputation: 0
I understand the codes to type in, I just don't know where to type them.
 
Old 06-03-2012, 08:28 PM   #11
TommyC7
Member
 
Registered: Mar 2012
Distribution: Slackware, CentOS, OpenBSD, FreeBSD
Posts: 435

Rep: Reputation: Disabled
No clue why you bumped a 3 year old thread, but here you go:

1) Right click the clock in xfce4-panel
2) Click Properties
3) Under clock options, you should see your clock with a drow-down menu, click "Custom"
4) Type in whatever you want as the original poster referenced.
 
Old 01-19-2014, 05:44 PM   #12
intotheunknown
LQ Newbie
 
Registered: Dec 2002
Distribution: Refracta (Debian)
Posts: 14

Rep: Reputation: 2
A HUGE thank you for posting these codes. Was having a hard time finding a way to change the 24 hour clock to am/pm. Got it working now. YEA! Bookmarked for future reference.
 
1 members found this post helpful.
Old 01-19-2014, 09:41 PM   #13
baldheaded-yeti
LQ Newbie
 
Registered: Oct 2011
Location: Tennessee
Distribution: Slackware 14.1
Posts: 25

Rep: Reputation: Disabled
Thumbs up

Quote:
Originally Posted by intotheunknown View Post
A HUGE thank you for posting these codes. Was having a hard time finding a way to change the 24 hour clock to am/pm. Got it working now. YEA! Bookmarked for future reference.
Same here...the same goes for JVM as well.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
using ps with the u option and custom formatting Leo Simon Linux - Software 1 05-29-2009 12:25 PM
BYE Clock skew detected. Check the clock on the file server Guardian-Mage Linux - Server 7 04-21-2009 09:48 AM
how to set system clock on Vector 5.9 Xfce chickenlinux Linux - Software 2 11-27-2008 04:02 PM
Are the hex codes for colors in a jpg the same codes as used in html? abefroman Linux - Security 3 07-31-2005 03:21 PM


All times are GMT -5. The time now is 05:24 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration