Created
March 12, 2016 09:23
-
-
Save meijeru/c1245f19dc8c5196ef18 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
now: func [ | |
"temporary replacement for Rebol-like now function, absent in Red" | |
/time | |
/local ts dd mm yy hh mm ss | |
][ | |
ts: read time-server | |
yy: to integer! copy/part ts 4 | |
mm: to integer! copy/part at ts 6 2 | |
dd: to integer! copy/part at ts 9 2 | |
hh: to integer! copy/part at ts 12 2 | |
mm: to integer! copy/part at ts 15 2 | |
ss: to float! copy/part at ts 18 2 | |
either time [ | |
make object! compose [ | |
hour: (hh) | |
minute: (mm) | |
second: (ss) | |
] | |
][ | |
make object! compose [ | |
day: (dd) | |
month: (mm) | |
year: (yy) | |
hour: (hh) | |
minute: (mm) | |
second: (ss) | |
] | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment