Current Time

This property is used to get the current date and time. You can access this when the Source is set to Global Properties.

You can use this property to display the current date and time on screen or pass it to the FlutterFlow or Custom widget.

Example

Let's see an example of getting the current date time and passing it to a widget (that supports accepting date-time).

Here is an example of how you can retrieve the current date and time:

  1. Select the widget (e.g., Text, TextField, Calendar) from the widget tree or canvas area.

  2. Move to the properties panel, and click on Set from Variable.

  3. Set the Source to Global Properties.

  4. Set the Available Options to the Current Time.

  5. If available, select the Date Format Options to format the date time.

  6. Click Confirm.

Custom formatting

Sometimes, you might need to display dates and times in a format that we don't support. This is where the custom date and time formatting comes into play. Custom Format enables you to represent date and time data in a multitude of ways.

For example, you can enter the text like 'yyyy/MM/dd || kk:mm', and the date time will be displayed as '2023/07/25 || 10:30'.

In the above example, 'yyyy/MM/dd || kk:mm is the custom format. Here's what it stands for:

  • yyyy represents a four-digit year, like "2023".

  • MM is a two-digit month, such as "07" for July.

  • dd indicates a two-digit day, for instance, "25".

  • kk is for a two-digit hour in 24-hour format, like "10".

  • mm stands for a two-digit minute, such as "30".

Here are some more format specifiers that you can use the build the custom format:

  • d: Day of the month. E.g., "2" for February 2nd.

  • E: Abbreviated weekday. E.g., "Mon" for Monday.

  • EEEE: Full weekday. E.g., "Monday".

  • LLL: Abbreviated standalone month. E.g., "Feb".

  • LLLL: Full standalone month. E.g., "February".

  • M: Month of year. E.g., "2" for February.

  • Md: Month and day. E.g., "2/2".

  • MEd: Abbreviated weekday, month, and day. E.g., "Mon, 2/2".

  • MMM: Abbreviated month. E.g., "Feb".

  • MMMd: Abbreviated month and day. E.g., "Feb 2".

  • MMMEd: Abbreviated weekday, month, and day. E.g., "Mon, Feb 2".

  • MMMM: Full month. E.g., "February".

  • MMMMd: Full month and day. E.g., "February 2".

  • MMMMEEEEd: Full month, weekday, day. E.g., "Monday, February 2".

  • QQQ: Abbreviated quarter. E.g., "Q1".

  • QQQQ: Full quarter. E.g., "1st quarter".

  • y: Year. E.g., "2023".

  • yM: Year and month. E.g., "2023/2".

  • yMd: Year, month, day. E.g., "2023/2/2".

  • yMEd: Weekday, year, month, day. E.g., "Mon, 2023/2/2".

  • yMMM: Abbreviated month and year. E.g., "Feb 2023".

  • yMMMd: Abbreviated month, day, year. E.g., "Feb 2, 2023".

  • yMMMEd: Weekday, month, day, year. E.g., "Mon, Feb 2, 2023".

  • yMMMM: Full month and year. E.g., "February 2023".

  • yMMMMd: Full month, day, year. E.g., "February 2, 2023".

  • yMMMMEEEEd: Weekday, full month, day, year. E.g., "Monday, February 2, 2023".

  • yQQQ: Abbreviated quarter, year. E.g., "Q1 2023".

  • yQQQQ: Full quarter, year. E.g., "1st quarter 2023".

  • H: Hour in day (24-hour). E.g., "15" for 3 PM.

  • Hm: Hour, minute (24-hour). E.g., "15:30".

  • Hms: Hour, minute, second (24-hour). E.g., "15:30:45".

  • j: Hour in day (12-hour). E.g., "3 PM".

  • jm: Hour, minute (12-hour). E.g., "3:30 PM".

  • jms: Hour, minute, second (12-hour). E.g., "3:30:45 PM".

  • m: Minute in hour. E.g., "30".

  • ms: Minute, second. E.g., "30:45".

  • s: Second in minute. E.g., "45".

  • G: Era designator. E.g., "AD" in "AD 2023".

  • L: Standalone month. E.g., "7" for July.

  • c: Standalone day. E.g., "2" for Tuesday.

  • h: Hour in AM/PM (1~12). E.g., "3" for 3 AM.

  • H: Hour in day (0~23). E.g., "15" for 3 PM.

  • S: Fractional second. E.g., "123" for 123 milliseconds.

  • D: Day in year. E.g., "50" for the 50th day of the year.

  • a: AM/PM marker. E.g., "AM" or "PM".

  • k: Hour in day (1~24). E.g., "24" for midnight.

  • K: Hour in AM/PM (0~11). E.g., "0" for 12 AM.

  • Q: Quarter. E.g., "4" for the fourth quarter.

For more detailed information, please refer to the DateFormat class documentation.


Last Updated Date: December 26, 2023

Last updated