Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,44 +0,0 @@
|
|||
with Ada.Calendar; use Ada.Calendar;
|
||||
with Ada.Calendar.Formatting; use Ada.Calendar.Formatting;
|
||||
with Ada.Text_IO; use Ada.Text_IO;
|
||||
|
||||
procedure Date_Format is
|
||||
function Image (Month : Month_Number) return String is
|
||||
begin
|
||||
case Month is
|
||||
when 1 => return "January";
|
||||
when 2 => return "February";
|
||||
when 3 => return "March";
|
||||
when 4 => return "April";
|
||||
when 5 => return "May";
|
||||
when 6 => return "June";
|
||||
when 7 => return "July";
|
||||
when 8 => return "August";
|
||||
when 9 => return "September";
|
||||
when 10 => return "October";
|
||||
when 11 => return "November";
|
||||
when 12 => return "December";
|
||||
end case;
|
||||
end Image;
|
||||
function Image (Day : Day_Name) return String is
|
||||
begin
|
||||
case Day is
|
||||
when Monday => return "Monday";
|
||||
when Tuesday => return "Tuesday";
|
||||
when Wednesday => return "Wednesday";
|
||||
when Thursday => return "Thursday";
|
||||
when Friday => return "Friday";
|
||||
when Saturday => return "Saturday";
|
||||
when Sunday => return "Sunday";
|
||||
end case;
|
||||
end Image;
|
||||
Today : Time := Clock;
|
||||
begin
|
||||
Put_Line (Image (Today) (1..10));
|
||||
Put_Line
|
||||
( Image (Day_Of_Week (Today)) & ", "
|
||||
& Image (Ada.Calendar.Month (Today))
|
||||
& Day_Number'Image (Ada.Calendar.Day (Today)) & ","
|
||||
& Year_Number'Image (Ada.Calendar.Year (Today))
|
||||
);
|
||||
end Date_Format;
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
#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
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
IDENTIFICATION DIVISION.
|
||||
PROGRAM-ID. Date-Format.
|
||||
|
||||
DATA DIVISION.
|
||||
WORKING-STORAGE SECTION.
|
||||
|
||||
01 Days-Area.
|
||||
03 Days-Data.
|
||||
05 FILLER PIC X(9) VALUE "Monday".
|
||||
05 FILLER PIC X(9) VALUE "Tuesday".
|
||||
05 FILLER PIC X(9) VALUE "Wednesday".
|
||||
05 FILLER PIC X(9) VALUE "Thursday".
|
||||
05 FILLER PIC X(9) VALUE "Friday".
|
||||
05 FILLER PIC X(9) VALUE "Saturday".
|
||||
05 FILLER PIC X(9) VALUE "Sunday".
|
||||
|
||||
03 Days-Values REDEFINES Days-Data.
|
||||
05 Days-Table PIC X(9) OCCURS 7 TIMES.
|
||||
|
||||
01 Months-Area.
|
||||
03 Months-Data.
|
||||
05 FILLER PIC X(9) VALUE "January".
|
||||
05 FILLER PIC X(9) VALUE "February".
|
||||
05 FILLER PIC X(9) VALUE "March".
|
||||
05 FILLER PIC X(9) VALUE "April".
|
||||
05 FILLER PIC X(9) VALUE "May".
|
||||
05 FILLER PIC X(9) VALUE "June".
|
||||
05 FILLER PIC X(9) VALUE "July".
|
||||
05 FILLER PIC X(9) VALUE "August".
|
||||
05 FILLER PIC X(9) VALUE "September".
|
||||
05 FILLER PIC X(9) VALUE "October".
|
||||
05 FILLER PIC X(9) VALUE "November".
|
||||
05 FILLER PIC X(9) VALUE "December".
|
||||
|
||||
03 Months-Values REDEFINES Months-Data.
|
||||
05 Months-Table PIC X(9) OCCURS 12 TIMES.
|
||||
|
||||
01 Current-Date-Str.
|
||||
03 Current-Year PIC X(4).
|
||||
03 Current-Month PIC X(2).
|
||||
03 Current-Day PIC X(2).
|
||||
|
||||
01 Current-Day-Of-Week PIC 9.
|
||||
|
||||
PROCEDURE DIVISION.
|
||||
MOVE FUNCTION CURRENT-DATE (1:8) TO Current-Date-Str
|
||||
|
||||
DISPLAY Current-Year "-" Current-Month "-" Current-Day
|
||||
|
||||
ACCEPT Current-Day-Of-Week FROM DAY-OF-WEEK
|
||||
DISPLAY
|
||||
FUNCTION TRIM(
|
||||
Days-Table (FUNCTION NUMVAL(Current-Day-Of-Week)))
|
||||
", "
|
||||
FUNCTION TRIM(
|
||||
Months-Table (FUNCTION NUMVAL(Current-Month)))
|
||||
" "
|
||||
Current-Day
|
||||
", "
|
||||
Current-Year
|
||||
END-DISPLAY
|
||||
|
||||
GOBACK
|
||||
.
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
(format-time-string "%Y-%m-%d")
|
||||
(format-time-string "%F") ;; new in Emacs 24
|
||||
;; => "2015-11-08"
|
||||
|
||||
(format-time-string "%A, %B %e, %Y")
|
||||
;; => "Sunday, November 8, 2015"
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
constant days = {"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"}
|
||||
constant months = {"January","February","March","April","May","June",
|
||||
"July","August","September","October","November","December"}
|
||||
|
||||
sequence now
|
||||
|
||||
now = date()
|
||||
now[1] += 1900
|
||||
|
||||
printf(1,"%d-%02d-%02d\n",now[1..3])
|
||||
printf(1,"%s, %s %d, %d\n",{days[now[7]],months[now[2]],now[3],now[1]})
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
using Dates
|
||||
ts = Dates.today()
|
||||
|
||||
println("Today's date is:")
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
(phixonline)-->
|
||||
<span style="color: #008080;">with</span> <span style="color: #008080;">javascript_semantics</span>
|
||||
<span style="color: #008080;">include</span> <span style="color: #000000;">builtins</span><span style="color: #0000FF;">\</span><span style="color: #004080;">timedate</span><span style="color: #0000FF;">.</span><span style="color: #000000;">e</span>
|
||||
<span style="color: #0000FF;">?</span><span style="color: #7060A8;">format_timedate</span><span style="color: #0000FF;">(</span><span style="color: #7060A8;">date</span><span style="color: #0000FF;">(),</span><span style="color: #008000;">"YYYY-MM-DD"</span><span style="color: #0000FF;">)</span>
|
||||
<span style="color: #0000FF;">?</span><span style="color: #7060A8;">format_timedate</span><span style="color: #0000FF;">(</span><span style="color: #7060A8;">date</span><span style="color: #0000FF;">(),</span><span style="color: #008000;">"Dddd, Mmmm d, YYYY"</span><span style="color: #0000FF;">)</span>
|
||||
<!--
|
||||
with javascript_semantics
|
||||
include builtins\timedate.e
|
||||
?format_timedate(date(),"YYYY-MM-DD")
|
||||
?format_timedate(date(),"Dddd, Mmmm d, YYYY")
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
"{0:yyyy-MM-dd}" -f (Get-Date)
|
||||
"{0:dddd, MMMM d, yyyy}" -f (Get-Date)
|
||||
# or
|
||||
(Get-Date).ToString("yyyy-MM-dd")
|
||||
(Get-Date).ToString("dddd, MMMM d, yyyy")
|
||||
|
|
@ -1,13 +1,12 @@
|
|||
import datetime
|
||||
|
||||
today = datetime.date.today()
|
||||
# The first requested format is a method of datetime objects:
|
||||
today.isoformat()
|
||||
# For full flexibility, use the strftime formatting codes from the link above:
|
||||
today.strftime("%A, %B %d, %Y")
|
||||
# This mechanism is integrated into the general string formatting system.
|
||||
# You can do this with positional arguments referenced by number
|
||||
"The date is {0:%A, %B %d, %Y}".format(d)
|
||||
# Or keyword arguments referenced by name
|
||||
"The date is {date:%A, %B %d, %Y}".format(date=d)
|
||||
# Since Python 3.6, f-strings allow the value to be inserted inline
|
||||
f"The date is {d:%A, %B %d, %Y}"
|
||||
|
||||
print(today.strftime("%Y-%m-%d"))
|
||||
# Or using the `isoformat` method of `date`.
|
||||
print(today.isoformat())
|
||||
|
||||
print(today.strftime("%A, %B %d, %Y"))
|
||||
# Or using a "format specifier" with `str.format` or an f-string.
|
||||
print("{today:%A, %B %d, %Y}".format(today=today))
|
||||
print(f"{today:%A, %B %d, %Y}")
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
REBOL [
|
||||
Title: "Date Formatting"
|
||||
URL: http://rosettacode.org/wiki/Date_format
|
||||
]
|
||||
|
||||
; REBOL has no built-in pictured output.
|
||||
|
||||
zeropad: func [pad n][
|
||||
n: to-string n
|
||||
insert/dup n "0" (pad - length? n)
|
||||
n
|
||||
]
|
||||
d02: func [n][zeropad 2 n]
|
||||
|
||||
print now ; Native formatting.
|
||||
|
||||
print rejoin [now/year "-" d02 now/month "-" d02 now/day]
|
||||
|
||||
print rejoin [
|
||||
pick system/locale/days now/weekday ", "
|
||||
pick system/locale/months now/month " "
|
||||
now/day ", " now/year
|
||||
]
|
||||
|
|
@ -1 +0,0 @@
|
|||
print format-date-time now "dddd, mmmm d, yyyy"
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
/*REXX pgm shows current date: yyyy-mm-dd & Dayofweek, Month dd, yyyy*/
|
||||
x = date('S') /*get current date as yyyymmdd */
|
||||
yyyy = left(x,4) /*pick off year (4 digs).*/
|
||||
dd = right(x,2) /*pick off day-of-month (2 digs).*/
|
||||
mm = substr(x,5,2) /*pick off month number (2 digs).*/
|
||||
say yyyy'-'mm"-"dd /*yyyy-mm-dd with leading zeroes.*/
|
||||
|
||||
weekday = date('W') /*dayofweek (Monday or somesuch).*/
|
||||
month = date('M') /*Month (August or somesuch).*/
|
||||
zdd = dd+0 /*remove leading zero from DD */
|
||||
say weekday',' month zdd"," yyyy /*format date as: Month dd, yyyy*/
|
||||
/*stick a fork in it, we're done.*/
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
/*REXX pgm shows current date: yyyy-mm-dd & Dayofweek, Month dd, yyyy*/
|
||||
/* ╔══════════════════════════════════════════════════════════════════╗
|
||||
║ function returns a specific example ║
|
||||
║ ─────────── ─────────────────────────── ──────────────────── ║
|
||||
║ date() dd mon yyyy 3 Jun 2009 ║
|
||||
║ date('N') (same as above) ║
|
||||
║ date('B') days since Jan 1, year 1 735382 ║
|
||||
║ date('C') days since Jan 1 this century 5264 ║
|
||||
║ date('D') days since Jan 1, this yr 154 ║
|
||||
║ date('E') dd/mm/yy 03/06/09 ║
|
||||
║ date('I') yyyy-mm-dd 2009-03-06 ║
|
||||
║ date('J') yyddd 2009154 ║
|
||||
║ date('M') month name June ║
|
||||
║ date('O') yy/mm/dd 09/03/06 ║
|
||||
║ date('S') yyyyddmm 20090603 ║
|
||||
║ date('T') seconds since Jan 1st, 1970 1401483686 ║
|
||||
║ date('U') mm/dd/yy 03/06/09 ║
|
||||
║ date('W') day─of─the─week Wednesday ║
|
||||
║ ─────────── ─────────────────────────── ──────────────────── ║
|
||||
║ ║
|
||||
║ Note: not all of the above are supported by all REXX versions. ║
|
||||
╚══════════════════════════════════════════════════════════════════╝ */
|
||||
parse value date('S') with yyyy 5 mm 7 dd /*get various pieces of date*/
|
||||
say yyyy'-'mm"-"dd /*yyyy-mm-dd with leading zeroes.*/
|
||||
|
||||
say date('W')"," date('M') word(date(), 1)"," yyyy
|
||||
/* [↑] dayofweek Month dd, yyyy*/
|
||||
/*stick a fork in it, we're done.*/
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
/*REXX pgm shows current date: yyyy-mm-dd & Dayofweek, Month dd, yyyy*/
|
||||
say date('I') /*yyyy-mm-dd with leading zeroes.*/
|
||||
|
||||
say date('W')"," date('M') word(date(), 1)"," left(date('S'),4)
|
||||
/* [↑] dayofweek Month dd, yyyy*/
|
||||
/*stick a fork in it, we're done.*/
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
'YYYY-MM-DD format
|
||||
WScript.StdOut.WriteLine Year(Date) & "-" & Right("0" & Month(Date),2) & "-" & Right("0" & Day(Date),2)
|
||||
|
||||
'Weekday_Name, Month_Name DD, YYYY format
|
||||
WScript.StdOut.WriteLine FormatDateTime(Now,1)
|
||||
Loading…
Add table
Add a link
Reference in a new issue