Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 

















User:Anakin101/digiclock

















User page
Talk
 

















Read
View source
View history
 








Tools
   


Actions  



Read
View source
View history
 




General  



What links here
Related changes
User contributions
User logs
View user groups
Upload file
Special pages
Permanent link
Page information
Get shortened URL
Download QR code
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 





Permanently protected page

From Wikipedia, the free encyclopedia
 

< User:Anakin101

 

{{User:Anakin101/digiclock
|format = 12 or 24 (default: 24)
|offset = number of hours + or - UTC (default: 0)
|size = width of each digit in pixels (default: 70)
|color = any color name or HTML color code (default: red)
}}

Like other user clocks at WP:CLOCK, this won't update in real time once the page has loaded, and due to the cache mechanism of the MediaWiki software, it may not update if the page is viewed often enough to be kept in the cache, unless you purge the page. But despite these limitations it usually works quite well.

Examples

Sizes and colors

You can have nearly any size, though the graphics have a base size of 70×112 pixels. You can have any color so long as it contrasts with black. ;)

Offsets

You can adjust the time by any number of hours and minutes. (The offset can be fractional.) E.g., offset=9.5 gives Australian Central Standard Time:

12-hour

Twelve-hour clocks get an extra segment for am/pm.

 
 

Borders

Normal HTML can be used to add borders and padding space. One tricky bit is that <div> elements expand to the full width of their container, which will make the box too wide. So we must specify an exact width for it, by multiplying the segment size by 5 (for 24-hour clocks) or 6 (for 12-hour clocks):

<div style="background:black; padding:5px 15px; border:3px inset cyan; width:300px;">
{{User:Anakin101/digiclock|format=12|size=50|color=cyan}}
</div>


 


A proposed CSS3 property called border-radius allows round borders. It is not finalized but Gecko-based browsers (Firefox and friends) and Webkit-based browsers (Safari, Chrome) support early versions of it (use both).

<div style="background:black; padding:5px 15px; border:3px inset cyan; -moz-border-radius:15px; -webkit-border-radius:15px; width:300px;">
{{User:Anakin101/digiclock|format=12|size=50|color=cyan}}
</div>


 


See Wikipedia:User page design center/Style for more borders.


Vertical clocks

Wrapping the clock in a div with the same width as the segments will make it vertical. Borders work as normal.

<div style="float:right; width:40px; border:5px solid black">
{{User:Anakin101/digiclock|size=40}}
</div>

Random colors

Parser magic can be used to pick a random color each time the page is generated. E.g., {{#time:U}} is the number of seconds since New Year 1970, so {{#expr:{{#time:U}} mod 6}} will produce a random number from 0 to 5. So if we put that in a {{#switch}} we can make a list of colors to choose from:

{{User:Anakin101/digiclock
|size = 50
|color = {{#switch:{{#expr:{{#time:U}} mod 6}} |0=red |1=orange |2=lime |3=yellow |4=cyan |5=magenta}}
}}


Suggestions?

Message me → User talk:Anakin101

See also

Multiple units of time

Type Adjustable Current Last Next
Date and time {{time}} {{Currentdate}} (MDY)
{{Plain now}} (DMY)
{{Now}} (DMY in a complete sentence)
{{Simple now}}
Date only {{Dateonly}}
{{Datedow}}
(Has the day of the week)
{{Date}} (Chose format)
{{DATE}} (prefixed by date=)
{{TODAY}} (DMY)
{{Yesterday}}
{{Day-1}}
{{Tomorrow}}
{{Day+1}}
Month and year only {{Monthyear}} {{Monthyear-1}} {{Monthyear+1}}
Time only {{Timeonly}} {{CURRENTTIME}} (12 h format)
{{CURRENTTIME24}} (24 h format)
Banners {{Right now}}
(Blue with time and number of Wikipedia articles)
Timestamp {{Timestamp}}
(Format YYYYMMDDhhmmss)

Single units of time

Unit of time Adjustable Current Last Next
SECOND {{CURRENTSECOND}}
MINUTE {{CURRENTMINUTE}}
HOUR {{CURRENTHOUR}}
WEEK {{CURRENTWEEK}}
{{CURRENTWEEKOFMONTH}}
Day of Week {{DAYOFWEEK}} {{CURRENTDAYNAME}}
{{CURRENTWEEKDAYABBREV}}
{{CURRENTWEEKDAY}}
MONTH {{MONTHNAME}}
{{MONTHABBREV}}
{{MONTHNUMBER}}
{{MONTH}} (zero padded)
{{CURRENTMONTHNAME}}
{{CURRENTMONTHABBREV}}
{{CURRENTMONTH1}}
{{CURRENTMONTHDAYS}}
{{LASTMONTHNAME}} {{NEXTMONTHNAME}}
Day of Month {{CURRENTDAY}}
{{CURRENTDAY2}} (zero padded)
YEAR {{CURRENTYEARCC}}
{{CURRENTYEARYY}}
{{CURRENTISOYEAR}}
{{CURRENTYEAR}}
{{LASTYEAR}} {{NEXTYEAR}}
Day of Year {{CURRENTDAYOFYEAR}}
DECADE {{DECADE}} {{CURRENTDECADE}}
CENTURY {{CENTURY}} {{CURRENTCENTURY}}
MILLENNIUM {{MILLENNIUM}}

Date and time templates made for substitution:

Month:
{{Lmonth}} produces Jun
{{Nmonth}} produces Aug
{{LastMonth}} produces June 2024
{{NextMonth}} produces August 2024


Individual templates

Categories of templates


Retrieved from "https://en.wikipedia.org/w/index.php?title=User:Anakin101/digiclock&oldid=1182648920"

Category: 
Time, date, and time zone user templates
Hidden category: 
Wikipedia semi-protected user and user talk pages
 



This page was last edited on 30 October 2023, at 15:08 (UTC).

Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Code of Conduct

Developers

Statistics

Cookie statement

Mobile view



Wikimedia Foundation
Powered by MediaWiki