Mini Micro supports dates/times in two different formats: as a string (by default in SQL format), and as a number of seconds since a reference date (Jan 01, 2000). The numeric format is useful for doing date/time calculations, like finding the amount of time between two dates, or adding some amount of time to a starting date/time.
For details on the format specifiers: https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings .
Functions
| Name |
Description
|
| nowVal |
Get the current date/time, as a number.
|
| now(format) |
Return the current date/time as a string. By default, format = "yyyy-MM-dd HH:mm:ss".
|
| str |
Convert a date (string or number) to a string with the given format. By default, format = "yyyy-MM-dd HH:mm:ss".
|
| val |
Convert a date string to a number. By default, format = "yyyy-MM-dd HH:mm:ss". If no date string is given, returns the current time (same as nowVal).
|
| year |
Get the year of the given date, as a number.
|
| month |
Get the month of the given date, as a number from 1 to 12.
|
| day |
Get the day of the given date, as a number from 1 to 31.
|
| hour |
Get the hour of the given date/time, as a number from 0 to 23.
|
| minute |
Get the minute of the given date/time, as a number from 0 to 59.
|
| second |
Get the second of the given date, as a number from 0 to 59.
|
| weekday |
Get the day of the week for the given date, from 0 (Sunday) to 6 (Saturday).
|
Properties
| Name |
Description
|
| weekdayNames |
Weekday name abbreviations, in the order returned by the weekday function. DO NOT CHANGE THESE, or the weekday function will no longer work.
|
Example
import "dateTime"
print "It is now: " + dateTime.now