regional-settings

How to get locale-independent modified time and creation time of a file in batch?

落花浮王杯 提交于 2019-11-28 13:00:30
With batch variable/parameter expansion like %~t1 one can get a timestamp of a file. I would like to set the year of the file to another variable would like to support multiple locales. How can you get a file's datetime, independent of locale and regional settings? No powershell please. I'll post few options 1) First one is with wmic (not available for XP home edition) ( LastModified can be changed with CreationDate or LastAccessed ) @echo off set file_loc=.\temp_file for %%# in ("%file_loc%") do set file_loc=%%~dpfnx# set file_loc=%file_loc:\=\\% for /f "delims=." %%t in ('"WMIC DATAFILE

How to get locale-independent modified time and creation time of a file in batch?

倖福魔咒の 提交于 2019-11-27 07:18:59
问题 With batch variable/parameter expansion like %~t1 one can get a timestamp of a file. I would like to set the year of the file to another variable would like to support multiple locales. How can you get a file's datetime, independent of locale and regional settings? No powershell please. 回答1: I'll post few options 1) First one is with wmic (not available for XP home edition) ( LastModified can be changed with CreationDate or LastAccessed ) @echo off set file_loc=.\temp_file for %%# in ("%file

Split %date% in a batch file regardless of Regional Settings

旧时模样 提交于 2019-11-27 05:36:15
Is there a way to split the %date% in a batch file (say, in 3 environment variables), but regardless of Regional Settings? Today's date would be 3/13/2013 for US, but with my Regional Settings it is 13.3.2013 - the delimiter is changed and the order as well . azhrei You can do it using wmic (but WMIC isn't included with XP Home): @ECHO OFF :: Check WMIC is available WMIC.EXE Alias /? >NUL 2>&1 || GOTO s_error :: Use WMIC to retrieve date and time FOR /F "skip=1 tokens=1-6" %%G IN ('WMIC Path Win32_LocalTime Get Day^,Hour^,Minute^,Month^,Second^,Year /Format:table') DO ( IF "%%~L"=="" goto s

Different languages issue when inserting formula from VBA

陌路散爱 提交于 2019-11-26 19:05:20
do I understand correctly, that if I use a command like Set myRange.formula = “=ROW(mySheet!R12)” my macro will cause #NAME? error appear in cells if it is run on, say, Russian Excel. I mean that in this case the above formula should be hard-coded like Set myRange.formula = “=СТРОКА(mySheet!R12)” where СТРОКА is the Russian analogue of the SUM function. I wouldn't anticipate Excel to be smart enough to translate the formulas in run-time. So is there any way around this and, most importantly, what is the most generic code to make the macro work correctly irrespective of languange ? VBA is very

Different languages issue when inserting formula from VBA

拟墨画扇 提交于 2019-11-26 05:38:29
问题 do I understand correctly, that if I use a command like Set myRange.formula = “=ROW(mySheet!R12)” my macro will cause #NAME? error appear in cells if it is run on, say, Russian Excel. I mean that in this case the above formula should be hard-coded like Set myRange.formula = “=СТРОКА(mySheet!R12)” where СТРОКА is the Russian analogue of the SUM function. I wouldn\'t anticipate Excel to be smart enough to translate the formulas in run-time. So is there any way around this and, most importantly,