Skip to content

Instantly share code, notes, and snippets.

@meijeru
Created March 12, 2016 09:23
Show Gist options
  • Save meijeru/c1245f19dc8c5196ef18 to your computer and use it in GitHub Desktop.
Save meijeru/c1245f19dc8c5196ef18 to your computer and use it in GitHub Desktop.
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