Yeah I guess it easier to keep information regarding time interval as integer...
But still, using the Format function you can convert all types of numeric format to a display format. For either Time or Date...
You might already know this, but let's assume you don't.
- Time is kept in a decimal format. 24 hours stand in between [0 - 1[. Knowing that, you could find out how much a second is worth. 24 hours = 86400 seconds. So 1 sec would be 1/86400 which is approximately 1.157407.
- Dates are kept as integer. From Day 0 (which is Dec 30th, 1899) to Today which is Day 37158. If you have a an integer with both decimal and integer parts you then have a complete Date / Time number.
You can use the following function to display time and dates :
<code>
Format(Now(),"dd-mm-yyyy hh:mm")
</code>
Will give you : 24-09-2001 13:14
You can simply use part of it to just display Date or Time as well, just change the "dd-mm-yyy hh:mm" part to what you want it to be.
The Now() function will give you both Current Date and Time.
The Date() function will give you current Date
If you place a number instead, it will translate it to a displayable date / time format.
Hope that helps
Enter your message below
Sign in or Join us (it's free).