Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
|
|
@ -1,8 +1,7 @@
|
|||
var
|
||||
now = new Date(),
|
||||
fmt1 = now.getFullYear() + '-' + (1 + now.getMonth()) + '-' + now.getDate(),
|
||||
weekdays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
|
||||
months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
||||
fmt2 = weekdays[now.getDay()] + ', ' + months[now.getMonth()] + ' ' + now.getDate() + ', ' + now.getFullYear();
|
||||
print(fmt1);
|
||||
print(fmt2);
|
||||
var now = new Date(),
|
||||
weekdays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
|
||||
months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
||||
fmt1 = now.getFullYear() + '-' + (1 + now.getMonth()) + '-' + now.getDate(),
|
||||
fmt2 = weekdays[now.getDay()] + ', ' + months[now.getMonth()] + ' ' + now.getDate() + ', ' + now.getFullYear();
|
||||
console.log(fmt1);
|
||||
console.log(fmt2);
|
||||
|
|
|
|||
5
Task/Date-format/Prolog/date-format.pro
Normal file
5
Task/Date-format/Prolog/date-format.pro
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
display_date :-
|
||||
get_time(Time),
|
||||
format_time(atom(Short), '%Y-%M-%d', Time),
|
||||
format_time(atom(Long), '%A, %B %d, %Y', Time),
|
||||
format('~w~n~w~n', [Short, Long]).
|
||||
12
Task/Date-format/REXX/date-format-1.rexx
Normal file
12
Task/Date-format/REXX/date-format-1.rexx
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
/*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.*/
|
||||
28
Task/Date-format/REXX/date-format-2.rexx
Normal file
28
Task/Date-format/REXX/date-format-2.rexx
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
/*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.*/
|
||||
6
Task/Date-format/REXX/date-format-3.rexx
Normal file
6
Task/Date-format/REXX/date-format-3.rexx
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
/*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,11 +0,0 @@
|
|||
/*show current date in yyyy-mm-dd and also Dayofweek, Month dd, yyyy*/
|
||||
x=date('s') /* yyyymmdd */
|
||||
yyyy=left(x,4) /* pick off the year. */
|
||||
dd=right(x,2) /* pick off the day of month */
|
||||
say yyyy'-'substr(x,5,2)"-"dd /*yyyy-mm-dd with leading 0s */
|
||||
|
||||
weekday =date('w') /* Dayofweek (Saturday) */
|
||||
month =date('m') /* Month (December) */
|
||||
zdd =dd+0 /* remove leading zero of DD */
|
||||
say weekday',' month zdd"," yyyy /*Month dd, yyyy */
|
||||
/*stick a fork in it, we're done.*/
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
puts Time.now
|
||||
puts Time.now.strftime('%Y-%m-%d')
|
||||
puts Time.now.strftime('%F') # same as %Y-%m-%d (ISO 8601 date formats)
|
||||
puts Time.now.strftime('%A, %B %d, %Y')
|
||||
|
|
|
|||
4
Task/Date-format/Smalltalk/date-format.st
Normal file
4
Task/Date-format/Smalltalk/date-format.st
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
| d |
|
||||
d := Date today.
|
||||
d printFormat: #(3 2 1 $- 1 1 2).
|
||||
(d weekday asString), ', ', (d monthName), ' ', (d dayOfMonth asString), ', ', (d year asString)
|
||||
Loading…
Add table
Add a link
Reference in a new issue