#icon = "" #title = "Insert Date" #tooltip = "Insert Date" 'dateformat.vbs dim d, t, da, da2, mo, mo2, ye ,ho, mi, format_date d = Date t = Time 'Msgbox d & t da = Day(d) mo = Month(d) da2 = Format2DigitString(Day(d)) mo2 = Format2DigitString(Month(d)) ye = Year(d) ho = Format2DigitString(Hour(t)) mi = Format2DigitString(Minute(t)) '30.01.2014_11:41 format_date = da2 &"."& mo2 &"."& ye &"_"& ho &":"& mi '30.01.2014_11:41:00 'format_date = da2 &"."& mo2 &"."& ye &"_"& t '30.янв.2014_23:47 'format_date = da2 &"."& MonthName(mo,True) &"."& ye &"_"& ho &":"& mi '30.январь.2014_23:47 'format_date = da2 &"."& MonthName(mo,False) &"."& ye &"_"& ho &":"& mi 'Msgbox format_date Function Format2DigitString(N) If N >= 10 Then Format2DigitString= Format2DigitString & N Else Format2DigitString= Format2DigitString & "0" & N End If End Function document.selection.Text = format_date |