Time and Date Desklet

UUID: TimeAndDate@nightflame
Last edited:
5 months ago 2024-04-19, 07:40
Last commit: [736fd806] TimeAndDate@nightflame: Add Dutch translation (#1134)

A fork desklet that displays the time and date

README

Close

Time and Date Cinnamon Desklet v0.1 - 19 June 2013

This is a simple desklet to display the time and date. The size and format of the date are configurable by changing the values in metadata.json. This can be launched from the Desklet itself by selecting Config from the menu.

Adjust the following paramters in the metadata.json file which is stored in ~/.local/share/cinnamon/desklets/TimeAndDate@nightflame:

"timeFormat": "%H:%M",
"timeSize": "50pt",
"dateFormat": "%A,%e %B",
"dateSize": "25pt"

REMEMBER TO LEAVE THE COMMAS IN - except for the last line!

The time and date format are from JavaScript toLocaleFormat function, and the possible values can be found at:

http://pubs.opengroup.org/onlinepubs/007908799/xsh/strftime.html

For exmple to add seconds change timeFormat to:

"timeFormat": "%H:%M:%S",

After changing the settings you need to remove and re-add the Desklet

If I knew what I was doing I would update the config through the GUI. Maybe next version.

-Steve desklets [at] stargw [dot] eu

Log In To Comment!

26 Comments

cavinlang
cavinlang-1 year ago
TimeAndDate@nightflame my customized files with a Lime Green color: /home/cavin/.local/share/cinnamon/desklets/TimeAndDate@nightflame/stylesheet.css .clock-container{ color: #00FF00; text-shadow: 1px 1px 2px #000; padding: 4px 10px 4px 10px; } .time-container{ } .date-container{ } .clock-date-label{} /home/cavin/.local/share/cinnamon/desklets/TimeAndDate@nightflame/metadata.json { "description": "A fork desklet that displays the time and date", "prevent-decorations": false, "uuid": "TimeAndDate@nightflame", "name": "Time and Date Desklet", "timeFormat": "%I:%M:%S %p", "timeSize": "40pt", "dateFormat": "%A, %b %d %Y", "dateSize": "15pt", "author": "none", "last-edited": 1691494689 }
l-one1
l-one1-2 years ago
A request: I don't know if this is something I can do manually or if a code update would be needed. Is there a way to fix the desklet box size to either a chosen size, or to its maximum size? Currently it changes depending on character count (Monday, 9 May has less characters and a narrower box than Wednesday, 10 September) - this results in the size of the box changing based on the day of the week and the month, which makes it impossible to consistently fit it between other desklets snugly and have the fitment remain unchanged.
Saul Ruiz
Saul Ruiz-2 years ago
hello pals I share with you the settings of my beautiful clock and some tips to customise your own clock. I hope you like it. https://github.com/saulsmith21/Time-and-Date-Desklet
cavinlang
cavinlang-2 years ago
I like this Desket very much. I have managed to change the color of the text & changed the time & date format ok. did take a little time to find out that I had to log out & back in for the changes to take effect. How ever I have not found a way to change the color of the frame. Is there a way I can do this?
richo
richo-2 years ago
thanks!!
Alan
Alan-3 years ago
Could there be a setting created in the next version to allow this to be all one line? TIME...DATE or visa vera? Just something like SingleLine: true or such. I would like to string it out just above my panel that is on the bottom.
paulkeenan523
paulkeenan523-4 years ago
Trying to get the time and date permanently displayed on browser. Any way to display your extension on top of other aps? TIA for any feedback.
lejuans01
lejuans01-4 years ago
https://www.lifewire.com/display-date-time-using-linux-command-line-4032698 hope this helps Display the date using any or all of the following elements: %a: abbreviated day name (i.e. mon, tue, wed) %A: full day name (i.e. Monday, Tuesday, Wednesday) %b or %h: abbreviated month name (i.e. jan, feb, mar) %B: full month name (January, February, March) %c: locales date and time (full date and time) %C: short year (i.e 14, 15, 16) %d: day of month (i.e. 01, 02, 03) %D: same as M/D/Y (i.e. 04/20/16) %e: day of month padded (i.e. ' 1', ' 2') %F: full date, same as yyyy-mm-dd %H: hour (00, 01, 02, 21, 22, 23) %I: hour (1,2,3,10,11,12) %j: day of year (i.e. 243) %k: hour padded (i.e. '1' becomes ' 1') %l: hour padded (12 hour clock) %m: month number (1,2,3) %M: minute (1,2,3,57,58,59) %n: new line %N: nanoseconds %p: AM or PM %P: like %p but lowercase (ironically) %r: locales 12 hour clock time %R: 24 hour version of hour and minute %s: seconds since 1970-01-01 00:00:00 %S: second (01,02,03, 57, 58, 59) %t: a tab %T: time same as %H:%M:%S %u: day of week (1 is Monday, 2 is Tuesday etc) %U: week number of year (assuming Sunday as first day of the week) %V: ISO week number with Monday as the first day of the week %w: day of week (0 is Sunday) %W: week number of the year with Monday as the first day of the week %x: locales date representation (12/31/2015) %X: locales time representation (14:44:44) %y: last two digits of year %Y: year %z: numeric time zone (i.e. -0400) %:z: numeric time zone as follows (i.e. -04:00) %::z: numeric time zone as follows (i.e. -04:00:00) %Z: alphabetic time zone abbreviation (GMT) - -: a single hyphen prevents zero padding _: a single underscore pads with spaces 0: pads with zeroes ^: use uppercase if possible #: use opposite case if possible To display just the time use the following: date +%T Alternatively, use the following: date +%H:%M:%S Attach the date, as well, using the command: date +%d/%m/%Y%t%H:%M:%S Use any combination of the above switches after the plus symbol to output the date as you so wish. If you want to add spaces you can use quotes around the date. date +'%d/%m/%Y %H:%M:%S' How to Show the UTC Date View the UTC date for your computer using the following command: date -u If you are in the UK you will notice that instead of showing "18:58:20" as the time it will show "17:58:20" as the time. How to Show the RFC Date View the RFC date for your computer using the following command: date --rfc-2822 This displays the date in the following format: Wed, 20 Apr 2018 19:56:52 +0100 This flag is useful as it shows that you are an hour ahead of GMT. Some Useful Date Commands Do you want to know the date next Monday? Try this: date -d "next Monday" At the point of writing this returns "Mon 25 Apr 00:00:00 BST 2016" The -d basically prints a date in the future. Using the same command you can find out which day of the week your birthday or Christmas falls upon. date -d 12/25/2016 The result is Sun Dec 25. Summary It is worth checking out the manual page for the date command using the following command: man date
dcardinale15
dcardinale15-4 years ago
Hi, I am trying to add am or pm. I tried adding :%p, after the :%M but it doesn't like it. I am still a noob so I would appreciate any help. Thanks all
lejuans01
lejuans01-4 years ago
{ "last-edited": 1599034184, "description": "A fork desklet that displays the time and date", "prevent-decorations": false, "uuid": "TimeAndDate@nightflame", "name": "Time and Date Desklet", "timeFormat": "%I:%M:%P", "timeSize": "40pt", "dateFormat": "%A,%e %B", "dateSize": "15pt" }
Benjamin Fenigsohn
Benjamin Fenigsohn-4 years ago
How to change the font size? I edited metadata.json, removed, then readded it and it's still the same size but changed in metadata.json.
dcardinale15
dcardinale15-4 years ago
apparently you need to log out and then back in for the changes to take effect. I have been just rebooting and I get that result
aadityalr123
aadityalr123-4 years ago
How can I modify this to display the number of days/hours/minutes from the start of a particular day?
fluntelion
fluntelion-4 years ago
When I want or need to change the color of the time and date display, I have to go a long way: /home/NAME/.local/share/cinnamon/desklets/TimeAndDate@nightflame/stylesheet.css. Whew! It is of course possible to add stylesheet.css as a bookmark in nemo, but it would be much more comfortable if you could add direct access to that file in the right-click menu. Would you do that? For me, and for everybody else, too? :-) Thank you for your attention.
crazymindstorm
crazymindstorm-4 years ago
hi is there a way to change the color of the desklet ?
Kashif Anwaar
Kashif Anwaar-5 years ago
For those who want to change it to 12 hour, change this in config = "timeFormat": "%l:%M", Good job, but changes in config requires restart.
Steven Martin
Steven Martin-5 years ago
Oddly, changing the metadata.json file makes no change to the Desklet, even after removing and restarting the clock. Is there some other trick?
Chris
Chris-5 years ago
I had to log out and then log back in for my changes in metadata.json to take place
marcositz
marcositz-5 years ago
Simple and functional. Perfect! Thank you!
83c577nbybd8zb
83c577nbybd8zb-5 years ago
any way to make it completely transparent? or change the background color?
marcositz
marcositz-5 years ago
Desklets> General Settings> No decoration
Nir Regev
Nir Regev-6 years ago
Nice one, thanks !
Mahesh Mankar
Mahesh Mankar-7 years ago
Is there any way to change color of text? I need date in another color.
Diego Gargaglione
Diego Gargaglione-7 years ago
Nice and useful. Is there any way to change the font?
Kevin Waite
Kevin Waite-7 years ago
Love it!!! I removed the one i was using from Cairo-dock as it did not respect the font sizes for date. This one does Thank you very much.
Olivier Brouillard
Olivier Brouillard-7 years ago
Simple, well designed and efficient. Thanks.