Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: YYYYMMDD date format

From: rchristiansen:pop:isdfa:sei-it at: 14-Nov-2000 10:15

A while ago I wrote and posted a script to the REBOL library which converts the date and time to a digit format (I use it mainly for creating chronological session IDs.) Here is the link and the script for your reference: http://www.rebol.com/library/html/time-in-digits.html REBOL [] time-in-digits: func [ "Convert the date and time from 'now' into a string of digits." sun-dial [date!] "The current date and time from 'now'" ][ year: to-string sun-dial/year month: to-string sun-dial/month if (length? month) < 2 [insert month "0"] day: to-string sun-dial/day if (length? day) < 2 [insert day "0"] current-time: sun-dial/time hour: to-string current-time/hour if (length? hour) < 2 [insert hour "0"] minutes: to-string current-time/minute if (length? minutes) < 2 [insert minutes "0"] seconds: to-string current-time/second if (length? seconds) < 2 [insert seconds "0"] rejoin [year month day hour minutes seconds] ]