PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

Each call to “Time and Date” returns the values from the first call.

Open itc-aminkin opened this issue 7 months ago • 1 comments

Microsoft PowerToys version

0.91.1

Installation method

PowerToys auto-update

Area(s) with issue?

Command Palette

Steps to reproduce

  1. Press Win+Alt+Space → Command Palette opens
  2. Type "Time and Date", select the command
  3. Current datetime copied correctly
  4. Repeat Step 1-2
  5. Previous datetime copied

✔️ Expected Behavior

Each call to “Time and Date” returns the current date and time.

❌ Actual Behavior

After the first call to “Time and Date”, the data is saved and is not updated during subsequent calls to the method.

Additional Information

Windows 10 Enterprise 22H2 14.03.2022 19045.5854 Windows Feature Experience Pack

Other Software

No response

itc-aminkin avatar Jun 10 '25 05:06 itc-aminkin

I also have this issue on Windows 11 Pro. The only thing I've found to "fix it" is to restart my whole computer and it only fixes it for the first time the command is called.

ChadGarion25 avatar Jun 11 '25 06:06 ChadGarion25

Is it not updating the clipboard content correctly or the data shown on the plugin page?

If you only need simple results (week, date, time) you can tipe their names in the plugin overview without opening the plugin page. These results should be always realtime.

/needinfo

htcfreek avatar Jun 12 '25 18:06 htcfreek

Is it not updating the clipboard content correctly or the data shown on the plugin page?

If you only need simple results (week, date, time) you can tipe their names in the plugin overview without opening the plugin page. These results should be always realtime.

/needinfo

For the first part, in the plug-in page, both the data displayed and the clipboard data are out of sync beyond the very first time it's called (so if it's 13:08 right now, the plugin will say something like 11:51 for "Time" and when I copy it by hitting enter it will copy 11:51).

Also, minor update, another time where the plugin page "fixes itself" also seems to be waking up from hibernation in addition to the shutdown solution I mentioned earlier. I haven't tested it thoroughly, it could have also been a restart instead of a hibernation.

For the second point, you are correct that if I specifically type in the word "Time" into Command Pallet and scroll down, the entry "Time" is "displaying" the current and correct time for when I typed in the word. However, this isn't even a temporary viable work around for me for the following reasons:

  1. First time I typed in "Time" or "Date" the result was nearly 12 items down in the list. Subsequent calls put it much closer to the top but
  2. Double clicking the entry (I have the setting for double click rather than single) or selectin the entry with arrow keys and hitting enter does nothing; it does not dismiss the command pallet and nothing is copied to the clipboard. It only displays the correct time which is the same thing my system clock does on the toolbar
  3. I rely on the plug-in method to do this task already; the time it would take for me to change the process I've already committed to repetitive memory for this sequence would be offset when the core error is eventually resolved. I'm better of manually typing out the date time stamp in terms of not redoing things

To be clear, I'm very grateful for your help and was not aware of this nuance of the display inside and outside the plugin page. I'm hoping this additional information provided will help diagnose the root issue and find a permeant solution

ChadGarion25 avatar Jun 12 '25 19:06 ChadGarion25

Double clicking the entry (I have the setting for double click rather than single) or selectin the entry with arrow keys and hitting enter does nothing; it does not dismiss the command pallet and nothing is copied to the clipboard. It only displays the correct time which is the same thing my system clock does on the toolbar

@moooyo We should check this. Don't we have copy command for the fall back item?

htcfreek avatar Jun 12 '25 22:06 htcfreek

For the first part, in the plug-in page, both the data displayed and the clipboard data are out of sync beyond the very first time it's called (so if it's 13:08 right now, the plugin will say something like 11:51 for "Time" and when I copy it by hitting enter it will copy 11:51).

@ChadGarion25 Does typing "time" on the plugin page shows the correct data when using it the second time? (Then the bug you hit is that reopening the page uses cached data until you change the query. Query a specific format triggers data generation then.)

/needinfo

htcfreek avatar Jun 12 '25 23:06 htcfreek

For the first part, in the plug-in page, both the data displayed and the clipboard data are out of sync beyond the very first time it's called (so if it's 13:08 right now, the plugin will say something like 11:51 for "Time" and when I copy it by hitting enter it will copy 11:51).

@ChadGarion25 Does typing "time" on the plugin page shows the correct data when using it the second time? (Then the bug you hit is that reopening the page uses cached data until you change the query. Query a specific format triggers data generation then.)

/needinfo

@htcfreek So it took me a few mins to test because it was easiest to see the updates on the min and here are my observations:

  • Opening the plugin page by typing the prefix I set ("n "), all the times are out of sync. Double clicking or using arrow keys to and enter anything will copy the wrong time that that is displayed
  • Typing in "time" DOES refresh all the time commands beyond just Time so that they both display and copy to clipboard the correct time
  • I got excited and tried it again by exiting out of the plugin window to the main Command Pallet window, closing command prompt, waiting for a min for everything to desync and tried this process again but using the word "now" instead of "time" because that's the one format I normally use. I got a different result then I expected; typing in "now" refreshed the time, but it didn't select the option "now" from the menu. Instead, "time" (the most recent command I typed in) was still at the top and when I hit enter it copied time instead. I can still manually double click or use arrow keys + enter to select "now" from the list, but typing either "now" or "Now" did not summon it like "time" or "date" does (date also works in both updating and summoning)
  • I did further testing, repeating the process a 3rd time and if I type "now utc", that does work for "Now UTC" format option

So to the main issue at hand, this is a more viable work around to the bug than I had before and may give you better information to diagnose the issue?

As for the "now" issue, that is probably something different all together and I'll submit a separate bug report later

Also, am I doing mentions correctly or should that only be used by people in charge?

ChadGarion25 avatar Jun 13 '25 01:06 ChadGarion25

Double clicking the entry (I have the setting for double click rather than single) or selectin the entry with arrow keys and hitting enter does nothing; it does not dismiss the command pallet and nothing is copied to the clipboard. It only displays the correct time which is the same thing my system clock does on the toolbar

@moooyo We should check this. Don't we have copy command for the fall back item?

I think we have?

Image

moooyo avatar Jun 26 '25 06:06 moooyo

Sorry for late reply. I'm working on the next release.

Anyone can summarize the current statue and tell me what's the problem is?

moooyo avatar Jun 26 '25 06:06 moooyo

@moooyo Sorry for not notifying you about the fix. The problem was that we returned cached results. Fix is merged.

htcfreek avatar Jun 26 '25 10:06 htcfreek