FormatMicroseconds.sql 456 B

123456789101112131415
  1. /* syntax version 1 */
  2. $parse = DateTime::Parse("%Y-%m-%d %H:%M:%S");
  3. $dt0 = $parse("2024-01-01 00:00:00");
  4. $dt1 = $parse("2024-01-01 00:00:00.000001");
  5. $dt2 = $parse("2024-01-01 00:00:00.05");
  6. $format = DateTime::Format("%Y-%m-%d %H:%M:%S");
  7. $format_ms = DateTime::Format("%Y-%m-%d %H:%M:%S", True as AlwaysWriteFractionalSeconds);
  8. SELECT
  9. $format($dt0), $format_ms($dt0),
  10. $format($dt1), $format_ms($dt1),
  11. $format($dt2), $format_ms($dt2)
  12. ;