fnStrToTime function

dynamic fnStrToTime(
  1. dynamic value
)

Expression function StrToTime(s): Converts a string to a time. In this Dart engine it returns a date serial number (days since 1899-12-30); see the manual, Appendix C.2.

Implementation

dynamic fnStrToTime(dynamic value) {
  final dt = DateTime.tryParse("1970-01-01T${varToStr(value)}");
  if (dt == null) return null;
  // Pure time: counts only what fraction of the day the time-of-day is,
  // no date-serial component.
  return (dt.hour * 3600 + dt.minute * 60 + dt.second) / 86400.0;
}