The clock in the Windows 11 taskbar at the bottom right does not display the seconds. Even clicking on the date and time does not show a clock. With these settings you get the time back with seconds display, without apps and without registry hacks.
Most users don’t need a second display in their daily work. However, at the latest when you as a system administrator want to check the exact time on your laptop or desktop. It would be helpful if there was a time display with seconds indicated somewhere on the desktop. What was easy in Windows 10 by clicking on the clock at the bottom right. Windows 11 leaves users without a second display; on the clock, the seconds indication is hidden by default.
Solution: Clock with seconds display in Windows 11
There is a way to get back the clock with seconds display so that a clock with a digital time including seconds can be show in Windows 11. And all without any additional software and without tricky registry tweak.
Clock with seconds display at the bottom right of the taskbar.
To do this, open Settings and navigate to Personalization -> Taskbar -> Taskbar behaviors (at the very bottom), enable by click the checkbox “Show seconds in system tray clock” again at the very bottom.
The time with seconds is now displayed in the taskbar system tray.
Next, press the Windows key and the R key samless on the keyboard to open the Run window.
In the Run window, enter the commandtimedate.cpland click OK
Here is a real-time clock with a moving seconds, as well as the digital time including seconds. You can set the date and time using the Change date and time button.
Open the Additional Clocks tab and click Show this clock, select the desired time zone if necessary and enter a display name. You can also set a second time zone.
By clicking on date and time at the bottom right of the taskbar system tray, the time will now be shown above the calendar.
Addendum
Hint. using several time websites on the Internet. The website https://time.is/ shows the real time including the seconds display. And not the one that is set on the computer, but the actual time in the time zone. The time web service informs you when the time set in the taskbar differs from the actual time.
This tutorial shows how to setup Xdebug 3 in WSL2 (Ubuntu 22.04) and VS Code on Windows 11
Most tips on the web for getting Xdebug to play with VS Code and WSL2 are using the php.ini settings from Xdebug 2, which is no longer supported by Xdebug 3.
let’s start Xdebug 3
First go to the Xdebug Installation Wizard. This page helps you finding which file to download, and how to configure PHP to get Xdebug running.
Next after Xdebug 3 is ready in WSL2 (Ubuntu), make sure the symlink file 99-xdebug.ini points to xdebug.ini.
cd /etc/php/8.2/cli/conf.d
ln -s /etc/php/8.1/mods-available/xdebug.ini 99-xdebug.ini
Edit the ini file using nano or vi/etc/php/8.2/cli/conf.d/99-xdebug.iniload the module last with 99.
If you are not familiar with the Linux shell, you can also access the WSL 2 file system from Windows to edit the xdebug.ini file. To do this, enter the following line in the explorer address bar to open the folder in which xdebug.ini is located.
\\wsl.localhost\Ubuntu\etc\php\8.2\mods-available
Note. here “Ubuntu” stands for my WSL instance, change it if necessary. The file 99-xdebug.ini is a symlink and points to xdebug.ini.
xdebug settings in php.ini
Add these lines to the end of your php.ini. The php.ini file can be found under Debian with php 8.2 in/etc/php/8.2/apache2/php.ini
Note. the path for zend_extension it depends on the php version, change the path to the xdebug.so if necessary!
VS Code WSL extension
Now reopen the workspace/folder using the Remote – WSL extension. To do this, you can bring them up by pressing F1 to open the Command Palette and typing in WSL, or by selecting the green remote indicator in the lower left corner of the status bar and select “Connect to WSL“. You will probably see the suggestion that the WSL extension should be added, just confirm with yes.
The WSL extension lets you use VS Code on Windows to build Linux applications that run on the Windows Subsystem for Linux (WSL). You get all the productivity of Windows while developing with Linux-based tools, runtimes, and utilities.
At the bottom right of the terminal pane you can see ports that forwarded to localhost port 9003, so VS Code interacts with Xdebug in WSL2.
Add Xdebug launch configuration
Now add PHP: Listen for Xdebug to the VS Code launch configuration with choose Run -> Open Configurations.
This the first section “Listen for Xdebug” is needed. If you want to try out more settings, go to my launch.json here.
VS Code Run and Debug
Open the file for debugging in your browser and open it in VS Code, now go to Run and Debug with hit Ctrl+Shift+D and start Listen for XdebugF5 or click the green arrow and reload the page from the browser.
A Chrome plugin called Xdebug helper which let you toggle debugging in chrome. You might want to skip temporarily debugging, it also provides profiling and tracing for Xdebug. This add-on is also available for Microsoft Edge did you can get here.
Finalize Xdebug in WSL2
Set the owner rights for the web server to the Xdebug log file.
$ chown www-data:www-data /var/log/xdebug.log
Don’t forget to restart the Apache web server.
$ systemctl restart apache2
Troubleshooting
If something went not as expected, the following commands can be helpful for troubleshooting.
How do I know if Xdebug is running? The next command should show the commonly output in the WSL2 Ubuntu.
$ php -v
PHP 8.2.12 (cli) (built: Oct 26 2023 17:33:49) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.12, Copyright (c) Zend Technologies
with Zend OPcache v8.2.12, Copyright (c), by Zend Technologies
with Xdebug v3.2.2, Copyright (c) 2002-2023, by Derick Rethans
The PHP information php -i command shows the status of xdebug.
You might also be interested in this related tutorial here.
Xdebug 3 and Visual Studio Code
The Lightweight Editor VS Code is a cross-platform editor for developers that differs from integrated development environments (IDE). Like Sublime or Eclipse, Visual Studio Code still supports debugging and autocompletion with IntelliSense. But it does not include integrated compilers and components such as version management.
However, Visual Studio Code makes it possible to adapt the environment (IDE) to the required development workflow. With a variety of extensions, so additional features can be integrated from the marketplace, such as the extension for Connect to WSL and Debug support for PHP with Xdebug. The PHP Hypertext Preprocessor must be provided according to the platform and version.
UNBLOG verwendet Cookies, um Dein Online-Erlebnis zu verbessern. Mit "ACCEPT" gibst Du Deine Zustimmung zur Nutzung dieser Website und unseren Datenschutzbestimmungen, oder wähle Cookie settings.
Diese Website verwendet Cookies, um Ihre Erfahrung zu verbessern, während Sie durch die Website navigieren. Von diesen werden die Cookies, die nach Bedarf kategorisiert werden, in Ihrem Browser gespeichert, da sie für das Funktionieren der grundlegenden Funktionen der Website wesentlich sind. Wir verwenden auch Cookies von Drittanbietern, mit denen wir analysieren und verstehen können, wie Sie diese Website nutzen. Diese Cookies werden nur mit Ihrer Zustimmung in Ihrem Browser gespeichert. Sie haben auch die Möglichkeit, diese Cookies zu deaktivieren. Das Deaktivieren einiger dieser Cookies kann sich jedoch auf Ihre Browser-Erfahrung auswirken.
Notwendige Cookies sind unbedingt erforderlich, damit die Website ordnungsgemäß funktioniert. Diese Kategorie enthält nur Cookies, die grundlegende Funktionen und Sicherheitsmerkmale der Website gewährleisten. Diese Cookies speichern keine persönlichen Informationen.
Alle Cookies, die für die Funktion der Website möglicherweise nicht besonders erforderlich sind und speziell zur Erfassung personenbezogener Daten des Benutzers über Analysen, Anzeigen und andere eingebettete Inhalte verwendet werden, werden als nicht erforderliche Cookies bezeichnet. Es ist obligatorisch, die Zustimmung des Benutzers einzuholen, bevor diese Cookies auf Ihrer Website ausgeführt werden.