utils.dart 392 B

12345678910111213
  1. import 'package:fis_common/extensions/date.dart';
  2. class JsonRpcUtils {
  3. static const String _datetimeFormat = "yyyy-MM-ddTHH:mm:ss.SSS";
  4. static const String _utcDateTimeFormat = "yyyy-MM-ddTHH:mm:ss.SSS'Z'";
  5. static String dateFormat(DateTime date) {
  6. if (date.isUtc) {
  7. return date.format(_utcDateTimeFormat);
  8. } else {
  9. return date.format(_datetimeFormat);
  10. }
  11. }
  12. }