Date are using standard C functions in order to manipulate a 32 bit integer. Dates are then represented as the number of seconds elapsed since 1st January 1970.

'int32 date_now() Return current date and time 'int32 date_new(string?) Parse a date format. The following formats are accepted :
  • null : return current date and time
  • YYYY-MM-DD HH:MM:SS : full date and time
  • YYYY-MM-DD : date only (time will be set to midnight)
  • HH:MM:SS : this represent an elapsed time. It will be corrected with timezone so you can subtract it from a date.
string date_format(#int32, fmt : string?) Format a date using strftime. If fmt is null then default format is used 'int32 date_set_hour(#int32, h : int, m : int, s : int) Change the time of a date. Return the modified date 'int32 date_set_day(#int32, y : int, m : int, d : int) Change the day of a date. Return the modified date { y => int, m => int, d => int} date_get_day(#int32) Return the year month and day of a date { h => int, m => int, s => int} date_get_hour(#int32) Return the hour minutes and seconds of a date int date_get_tz() Return the local Timezone (in seconds)
Report an issue | Contribute to this page

©2017 Haxe Foundation