Time/Date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My table has a TimeInSec field (Time/Date datatype). This field has ALL
NEGATIVE numbers in seconds.

I used the following expression to change to regular time format.
Format ([TimeInSec]\3600,"00\:") & Format(([TimeInSec]\60) Mod 60,"00\:") &
Format([TimeInSec] Mod 60,"00")

How can I just put one minus (-) in front of regular time format?

Thank you.
 
Jay said:
My table has a TimeInSec field (Time/Date datatype). This field has ALL
NEGATIVE numbers in seconds.

I used the following expression to change to regular time format.
Format ([TimeInSec]\3600,"00\:") & Format(([TimeInSec]\60) Mod 60,"00\:") &
Format([TimeInSec] Mod 60,"00")

How can I just put one minus (-) in front of regular time format?

THere are more subtle ways to do this, but why not the
obvious:

Format(TimeInSec\3600,"00\:") & Format((-TimeInSec\60) Mod
60,"00\:") & Format(-TimeInSec Mod 60,"00")
 
Marshall said:
THere are more subtle ways to do this, but why not the
obvious:

Format(TimeInSec\3600,"00\:") & Format((-TimeInSec\60) Mod
60,"00\:") & Format(-TimeInSec Mod 60,"00")

Subtle?

Format$(TimeInSec / 24 / 60 / 60, "-hh:mm:ss")
 
Format$(TimeInSec / 24 / 60 / 60, "-hh:mm:ss")


The issue with that approach is that it can not deal with
situations where TimeInSec is more than 24 hours.
 
Back
Top