how to display a midnight value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • phill86
    New Member
    • Mar 2008
    • 121

    how to display a midnight value

    Hi,

    I am trying to enter a date/time "general date" format in a table and a form as follows

    01/01/2008 12:00:00

    but as soon as i enter 02/01/2008 00:00:00 the 00:00:00 disapears and i need to be able to display it in my from.

    also if i just type in the time value as 00:00:00 it remains

    am i just being really dumb?

    please help this is driving me nuts
  • Stewart Ross
    Recognized Expert Moderator Specialist
    • Feb 2008
    • 2545

    #2
    Hi. The General Date format is doing what it is supposed to do - it displays a date if there is one, or a time if there is no date - but not both. To have both shown at the same time, enter the following custom format in the format property of the table field or control concerned (in place of the words General Date if this is the default)
    Code:
    dd/mm/yyyy hh:nn (uk format)
    mm/dd/yyyy hh:nn (us format)
    If you need the AM and PM times distinguished add AM/PM to the end of the custom format.

    -Stewart

    Comment

    • phill86
      New Member
      • Mar 2008
      • 121

      #3
      Originally posted by Stewart Ross Inverness
      Hi. The General Date format is doing what it is supposed to do - display a date if it is a date, or a time if it is a time. To have both at the same time, you need to enter the following custom format in the format property of the table field or control concerned:
      Code:
      dd/mm/yyyy hh:nn (uk format)
      mm/dd/yyyy hh:nn (us format)
      If you need the AM and PM times distinguished add AM/PM to the end of the custom format.

      -Stewart
      Hi Stewart

      Sorted thanks
      Cheers Phill

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32656

        #4
        Dates are stored as integer values and times are stored as fractions of an integer.

        As midnight is essentially 0 seconds into any day, the time portion of the value = 0. Thus it looks like a date on its own.

        Without explicit formatting, a date alone is displayed as a date, a time alone is displayed as a time and a date / time value is shown as both.

        Midnight is assumed to be a stand-alone date therefore the time element is not shown by default.

        Comment

        Working...