device_time_format 0.0.1 copy "device_time_format: ^0.0.1" to clipboard
device_time_format: ^0.0.1 copied to clipboard

PlatformAndroid

A Flutter plugin to get the device's current time and detect whether the system uses 12-hour or 24-hour format.

device_time_format #

A Flutter plugin to get the device's current time and detect whether the system is set to 12-hour or 24-hour time format.

Platform Support #

Android iOS
Yes No

Features #

  • Get the current device time as a formatted string (respects system 12hr/24hr setting)
  • Check whether the device is using 12-hour or 24-hour format

Usage #

import 'package:device_time_format/device_time_format.dart';

final deviceTimeFormat = DeviceTimeFormat();

// Get formatted current time String? time = await deviceTimeFormat.getDeviceTime(); print(time); // e.g. "06:06:25 am" or "18:06:25"

// Check format type bool? is24Hour = await deviceTimeFormat.is24HourFormat(); print(is24Hour); // true or false

Example #

See the example/ folder for a complete working app.

4
likes
150
points
66
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin to get the device's current time and detect whether the system uses 12-hour or 24-hour format.

Homepage

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on device_time_format

Packages that implement device_time_format