Differences
This shows you the differences between the selected revisions of the page.
script_formatting_timestamp_batch_file 2018-08-20 | script_formatting_timestamp_batch_file 2023-04-24 (current) | ||
Line 7: | Line 7: | ||
The ''%TIMESTAMP%'' syntax can be used as: | The ''%TIMESTAMP%'' syntax can be used as: | ||
- | * A locale-independent alternative to the ''date'' command/variable; ((The ''date'' command/variable uses locale-specific format, so common syntax like ''%%%date~...%%%'' yields expected ''%%yyyymmdd...%%'' value on US-locale only.)) | + | * A locale-independent alternative to the ''date'' command/variable; ((The ''date'' command/variable uses locale-specific format, so common syntax like ''<nowiki>%date:~10,4%%date:~4,2%%date:~7,2%</nowiki>'' yields expected ''%%yyyymmdd%%'' value on US-locale only.)) |
* An easy way to calculate relative times, like yesterday date, tomorrow date, time one hour ago, etc. | * An easy way to calculate relative times, like yesterday date, tomorrow date, time one hour ago, etc. | ||
Line 67: | Line 67: | ||
</code> | </code> | ||
- | To calculate relative times, use methods of the ''[[dotnet>system.datetime|DateTime]]'' class, like the ''[[dotnet>system.datetime.adddays|AddDays]]''. To format the calculated timestamp, use the ''[[dotnet>system.datetime.tostring#System_DateTime_ToString_System_String_|ToString]]'' method. | + | To calculate relative times, use methods of the ''[[dotnet>system.datetime|DateTime]]'' class, like the ''[[dotnet>system.datetime.adddays|AddDays]]''. To format the calculated timestamp, use the ''[[dotnet>system.datetime.tostring#system-datetime-tostring(system-string)|ToString]]'' method. |
<code powershell> | <code powershell> |