Time for an 2014 update…
This commit is contained in:
parent
372c577f83
commit
09687c4926
2520 changed files with 34227 additions and 7318 deletions
31
Task/Date-format/AutoIt/date-format.autoit
Normal file
31
Task/Date-format/AutoIt/date-format.autoit
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#include <Date.au3>
|
||||
|
||||
$iYear = 2007
|
||||
$iMonth = 11
|
||||
$iDay = 10
|
||||
|
||||
ConsoleWrite(StringFormat('%4d-%02d-%02d', $iYear, $iMonth, $iDay) & @LF)
|
||||
|
||||
$iWeekDay = _DateToDayOfWeekISO($iYear, $iMonth, $iDay)
|
||||
ConsoleWrite(StringFormat('%s, %s %02d, %4d', _GetLongDayLocale($iWeekDay), _GetLongMonthLocale($iMonth), $iDay, $iYear) & @LF)
|
||||
|
||||
|
||||
Func _GetLongDayLocale($_iWeekDay) ; 1..7 Monday=1
|
||||
Local $aDayName[8] = [0, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30]
|
||||
Return GetLocaleInfo($aDayName[$_iWeekDay])
|
||||
EndFunc
|
||||
|
||||
Func _GetLongMonthLocale($_iMonth) ; 1..12 January=1
|
||||
Local $aMonthName[13] = [0, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43]
|
||||
Return GetLocaleInfo($aMonthName[$_iMonth])
|
||||
EndFunc
|
||||
|
||||
Func GetLocaleInfo($_LCType)
|
||||
Local $ret, $LCID, $sBuffer, $iLen
|
||||
$ret = DllCall('kernel32', 'long', 'GetSystemDefaultLCID')
|
||||
$LCID = $ret[0]
|
||||
$ret = DllCall('kernel32', 'long', 'GetLocaleInfo', 'long', $LCID, 'long', $_LCType, 'str', $sBuffer, 'long', 0)
|
||||
$iLen = $ret[0]
|
||||
$ret = DllCall('kernel32', 'long', 'GetLocaleInfo', 'long', $LCID, 'long', $_LCType, 'str', $sBuffer, 'long', $iLen)
|
||||
Return $ret[3]
|
||||
EndFunc
|
||||
15
Task/Date-format/PL-I/date-format-1.pli
Normal file
15
Task/Date-format/PL-I/date-format-1.pli
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
df: proc Options(main);
|
||||
declare day_of_week(7) character (9) varying initial(
|
||||
'Sunday','Monday','Tuesday','Wednesday',
|
||||
'Thursday','Friday','Saturday');
|
||||
declare today character (9);
|
||||
|
||||
today = datetime('YYYYMMDD');
|
||||
put edit(substr(today,1,4),'-',substr(today,5,2),'-',substr(today,7))
|
||||
(A);
|
||||
|
||||
today = datetime('MmmDDYYYY');
|
||||
put skip edit(day_of_week(weekday(days())),', ') (A);
|
||||
put edit(substr(today,1,3),' ',substr(today,4,2),', ',
|
||||
substr(today,6,4))(A);
|
||||
end;
|
||||
16
Task/Date-format/PL-I/date-format-2.pli
Normal file
16
Task/Date-format/PL-I/date-format-2.pli
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
df: proc Options(Main);
|
||||
declare day_of_week(7) character(9) varying initial(
|
||||
'Sunday','Monday','Tuesday','Wednesday',
|
||||
'Thursday','Friday','Saturday');
|
||||
declare today character(8);
|
||||
declare month(12) character(10) varying initial(
|
||||
'January','February','March','April','May','June','July',
|
||||
'August','September','October','November','December');
|
||||
|
||||
Put edit(translate('abcd-ef-gh',datetime('YYYYMMDD'),'abcdefgh'))(a);
|
||||
today = datetime('MMDDYYYY');
|
||||
|
||||
put skip edit(day_of_week(weekday()),', ') (A);
|
||||
put edit(month(substr(today,1,2)),' ',substr(today,3,2),', ',
|
||||
substr(today,5,4))(A);
|
||||
End;
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
declare day_of_week(7) character (9) varying initial
|
||||
'Sunday', 'Monday', 'Tuesday', 'Wednesday',
|
||||
'Thursday', 'Friday', 'Saturday');
|
||||
declare today character (8);
|
||||
|
||||
today = datetime('YYYYMMDD');
|
||||
put edit (substr(today, 1, 4), '-', substr(today, 5, 2), '-', substr(today, 7) ) (A);
|
||||
|
||||
today = datetime('MmmDDYYYY');
|
||||
|
||||
put skip edit (day_of_week(weekday(days())), ', ') (A);
|
||||
put edit (substr(today, 1, 3), ' ', substr(today, 4, 2), ',', substr(today, 6, 4) ) (A);
|
||||
4
Task/Date-format/VBA/date-format.vba
Normal file
4
Task/Date-format/VBA/date-format.vba
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
Function DateFormats()
|
||||
Debug.Print Format(Date, "yyyy-mm-dd")
|
||||
Debug.Print Format(Date, "dddd, mmmm dd yyyy")
|
||||
End Function
|
||||
Loading…
Add table
Add a link
Reference in a new issue