Sign in to follow this  
Followers 0
power1power1

Chnaging the taskbar clock format

10 posts in this topic

Hello, I am thinking of chnaging the taskbar clock format to show like this in two lines:

10:12:34 AM PDT

Sat. 11 Jan 2014

Any clue as where to start is appreciated. Thanks!

Share this post


Link to post
Share on other sites



Not really AutoIt but you can do this by Start button 4f6cbd09-148c-4dd8-b1f2-48f232a2fd33_818, clicking Control Panel, clicking Clock, Language, and Region, and then clicking Region and Language.

Click Additional Settings, Date Tab, and in short date enter: ddd dd MMM yyyy

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thanks for the reply. I know T-Clock 2010 here: http://www.donationcoder.com/forum/index.php?topic=21944.0 does that. It has a few extra features which I don't need, so I thought I would write a little piece of Autoit code to do just that.

Edited by power1power1

Share this post


Link to post
Share on other sites

OK, it seems it may not be an easy task to do. Another question then:

When running an Autoit script, is it possible to have a text box, instead of the icon, in the notification area? I am thinking of updating the text in that text box.

Share this post


Link to post
Share on other sites

You could create a GUI that covers the taskbar area over the clock and overlay your own clock.  Here is a start just need to update the label with Time and Date to your liking format and tweak in position, color, ect.

#NoTrayIcon
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <Misc.au3>
#include <StaticConstants.au3>

HotKeySet("{ESC}", "_Exit")

GuiCreate("NewClock", 100, 40, @DesktopWidth-120, @DesktopHeight-40, $WS_POPUP, $WS_EX_TOPMOST+$WS_EX_TOOLWINDOW)
GUISetBkColor(0x070C0F)
GUICtrlCreateLabel("1:50 PM" & @CRLF & "Sun 12 Jan 2014", 1, 5, 100, 40, $SS_CENTER)
GUICtrlSetBkColor(-1, 0x070C0F)
GUICtrlSetColor(-1, 0xFFFFFF)

GUISetState(@SW_SHOW)

While 1
    Sleep(50)
WEnd

Func _Exit()
    Exit
EndFunc

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Great, thanks Universalist! One question though: The created GUI may cover some of the rightmost icons in the notification area. Is there a way to set the position of the rightmost icon in the notification area?

Edited by power1power1

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Just change the GUI size to fit within the clock area and adjust the position as well. When I created the GUI it didn't cover up any of my icons but my time/date in the corner maybe a little bigger cause I already have the date and time in mine.

Also change the Font of the label (text) to get what you want.

You can increase the size of the time/date by following changing the format above to increase default size of the area then overlapping the GUI to be able to fit what you want in that area.

Edited by Rogue5099

Share this post


Link to post
Share on other sites

Sure. Still, it would be nice if one could set the position of the rightmost icon so that a bigger area would be available. :)

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

This fits perfectly in my taskbar covering up the time.  You might also need to change the date format on your computer to make _NowDate display how you want it to.

#NoTrayIcon
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <Date.au3>

HotKeySet("{ESC}", "_Exit")

Global $Lastsec, $Lastmin
GuiCreate("NewClock", 100, 40, @DesktopWidth-120, @DesktopHeight-36, $WS_POPUP, $WS_EX_TOPMOST+$WS_EX_TOOLWINDOW)
GUISetBkColor(0x070C0F)
$Timedate = GUICtrlCreateLabel("", 1, 3, 100, 40, $SS_CENTER)
GUICtrlSetFont(-1, 9, 400)
GUICtrlSetBkColor(-1, 0x070C0F)
GUICtrlSetColor(-1, 0xFFFFFF)
$Date = _NowDate()
GUICtrlSetData(-1, _NowTime() & @CRLF & $Date)
AdlibRegister("UpdateTime", 200)

GUISetState(@SW_SHOW)

While 1
    Sleep(10)
WEnd

Func UpdateTime()
    Local $CurrentSec = @SEC    ;Prevents flickering
    Local $Currentmin   = @MIN  ;Prevents flickering
    If $CurrentSec <> $Lastsec Then
        $Lastsec = $CurrentSec
        GUICtrlSetData($Timedate, _NowTime() & @CRLF & $Date)
    EndIf
    If $Currentmin <> $Lastmin Then
        $Lastmin = $Currentmin
        $Date = _NowDate()
        GUICtrlSetData($Timedate, _NowTime() & @CRLF & $Date)
    EndIf
EndFunc   ;==>UpdateTime

Func _Exit()
    Exit
EndFunc

Edit:
Added ToolTip like windows has. I was also trying to allow double click label to run ShellExecute("timedate.cpl") but was not successful.
 

#NoTrayIcon
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <Date.au3>

HotKeySet("{ESC}", "_Exit")

Global $Lastsec, $Lastmin
GuiCreate("NewClock", 100, 40, @DesktopWidth-120, @DesktopHeight-36, $WS_POPUP, $WS_EX_TOPMOST+$WS_EX_TOOLWINDOW)
GUISetBkColor(0x070C0F)
$Timedate = GUICtrlCreateLabel("", 1, 3, 100, 40, $SS_CENTER)
GUICtrlSetTip(-1, _DateTimeFormat(_NowCalc(), 1), "", 0, 1)
GUICtrlSetFont(-1, 9, 400)
GUICtrlSetBkColor(-1, 0x070C0F)
GUICtrlSetColor(-1, 0xFFFFFF)
$Date = _NowDate()
GUICtrlSetData(-1, _NowTime() & @CRLF & $Date)
AdlibRegister("UpdateTime", 200)

GUISetState(@SW_SHOW)

While 1
    Sleep(10)
WEnd

Func UpdateTime()
    Local $CurrentSec = @SEC    ;Prevents flickering
    Local $Currentmin   = @MIN  ;Prevents flickering
    If $CurrentSec <> $Lastsec Then
        $Lastsec = $CurrentSec
        GUICtrlSetData($Timedate, _NowTime() & @CRLF & $Date)
        $FullTime = _NowCalc()
    EndIf
    If $Currentmin <> $Lastmin Then
        $Lastmin = $Currentmin
        $Date = _NowDate()
        GUICtrlSetTip($Timedate, _DateTimeFormat(_NowCalc(), 1), "", 0, 1)
        GUICtrlSetData($Timedate, _NowTime() & @CRLF & $Date)
    EndIf
EndFunc   ;==>UpdateTime

Func _Exit()
    Exit
EndFunc
Edited by Rogue5099

Share this post


Link to post
Share on other sites

Very good, thanks! I think this can be used to provide for a clock on the second monitor's taskbar, as well.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0