Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
27
Task/Date-manipulation/J/date-manipulation-1.j
Normal file
27
Task/Date-manipulation/J/date-manipulation-1.j
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
require'dates'
|
||||
months=: <;._2 tolower 0 :0
|
||||
January
|
||||
February
|
||||
March
|
||||
April
|
||||
May
|
||||
June
|
||||
July
|
||||
August
|
||||
September
|
||||
October
|
||||
November
|
||||
December
|
||||
)
|
||||
|
||||
numbers=: _".' '"_`(1 I.@:-e.&(":i.10)@])`]}~
|
||||
words=: [:;:@tolower' '"_`(I.@(tolower = toupper)@])`]}~
|
||||
getyear=: >./@numbers
|
||||
getmonth=: 1 + months <./@i. words
|
||||
getday=: {.@(numbers -. getyear)
|
||||
gethour=: (2 { numbers) + 12 * (<'pm') e. words
|
||||
getminsec=: 2 {. 3}. numbers
|
||||
|
||||
getts=: getyear, getmonth, getday, gethour, getminsec
|
||||
timeadd=: 1&tsrep@+&tsrep
|
||||
deltaT=: (1 tsrep 0)&([ + -@#@[ {. ])
|
||||
6
Task/Date-manipulation/J/date-manipulation-2.j
Normal file
6
Task/Date-manipulation/J/date-manipulation-2.j
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
(deltaT 12 0 0) timeadd getts 'March 7 2009 7:30pm EST'
|
||||
2009 3 8 7 30 0
|
||||
timestamp (deltaT 12 0 0) timeadd getts 'March 7 2009 7:30pm EST'
|
||||
08 Mar 2009 07:30:00
|
||||
isotimestamp (deltaT 12 0 0) timeadd getts 'March 7 2009 7:30pm EST'
|
||||
2009-03-08 07:30:00.000
|
||||
Loading…
Add table
Add a link
Reference in a new issue