Date

  • put the date // outputs: 4/19/14
  • put the long date // outputs: Saturday, April 19, 2014
  • put the abbreviated date // outputs: Sat, Apr 19, 2014
  • put the short date // outputs: 4/19/14
  • put the english date // outputs: 4/19/14
  • put the system date // outputs: 2014-04-19
  • put the internet date // outputs: Sat, 19 Apr 2014 21:53:45 +0200

Getting indivdual elements of the date

If none of LiveCode’s built in date formats meet your needs, you can use the dateItems function and convert a date to a comma delimated list consisting of:

  • the year
  • the month number
  • the day of the month
  • the hour in 24-hour time
  • the minute
  • the second
  • the numeric day of the week where Sunday is day 1, Monday is day 2, and so forth

You can then use these items to format your date or extract the individual elements you need. e.g.

put the date into varDate
convert varDate to dateItems
put item 1 of varDate // outputs the current year
put item 2 of varDate // outputs the current month
put item 3 of varDate // outputs the current day

Time

Getting the time is very simliar to getting the date.

put the time // outputs eg. 10:12 PM

and simliarly

put the long time // outputs: 10:51:33 PM
put the abbreviated time // outputs: 10:51 PM
put the short time // outputs: 10:51 PM
put the english time // outputs: 10:51 PM
put the system time // outputs: 10:51:33 PM

12 hour / 24 hour time

If you want to use 24hour time you need to set the twelveHourTime property to false before accessing the time

set the twelveHourTime to false
put the time // outputs eg. 12:12 PM

Just like converting the date to a comma delimated list, you can do the same to the time

put the time into varTime
convert varTime to dateItems
put varTime

the order of the items stats the same –

  • the year
  • the month number
  • the day of the month
  • the hour in 24-hour time
  • the minute
  • the second
  • the numeric day of the week where Sunday is day 1, Monday is day 2, and so forth

Milliseconds

The milliseconds function returns the total number of milliseconds since midnight GMT, January 1, 1970. (A millisecond is one-thousandth of a second.)

put the milliseconds
// or
put the millisecs
Contact Us

We're not around right now. But you can send us an email and we'll get back to you, asap.

Not readable? Change text. captcha txt

Start typing and press Enter to search