Hello, In all of my macros, the time is currently displaying in milliseconds. I'm not sure why its doing it and haven't been able to find a fix. Does anyone know what might cause it?
Thanks!
Hello, In all of my macros, the time is currently displaying in milliseconds. I'm not sure why its doing it and haven't been able to find a fix. Does anyone know what might cause it?
Thanks!
You would need to show us an example of:
before we can form any impression of what you are describing, and how it could be changed.
See:
Thanks for your reply! The screenshot shows the input request at the beginning of the macro. I want the date to show as yyyy/mm/dd, but instead have the long string of numbers.
Thanks
A date-time value formed by one of the Keyboard Maestro Calculation functions is a string representation of a number of milliseconds since the unix epoch (dot of midnight at the UTC start of 1970)
See: Date/Time Functions and Calculations
which is a section in the lower part of this page:
Dates and Times [Keyboard Maestro Wiki]
You can display these values as formatted calendar strings (rather than integer strings) by sandwiching their names inside this kind of structure:
%ICUDateTimeFor% ... %EEE, MMM d, yyyy%
with:
%ICUDateTimeFor%
to their left, andSo for example:
which might return a display like:
Thanks for your help. I think I must be missing something. I've set it up as you have (I think?), but it's still giving in milliseconds. Just to clarify, the date I'm wanting to show as ICU is coming from a user input box.
Thanks again!
yy/MM/dd
string shown below ? (year first ?)If you need to obtain the results of any calculations involving the date, you will need to capture the millisecond version which calculation functions can use. (You can still display the millisecond version as a calendar string)
If you just need a human-legible string, then you should be able to do something like this:
Prompt for date value.kmmacros (3.4 KB)
and more flexibly:
date
) (in case further calculations are needed)Prompt for date value II.kmmacros (3.9 KB)
That works! Thank you so much for your help and patience. I'm on a steep (but really interesting) learning curve.