input mask for datetime field

  • Thread starter Thread starter mcnews
  • Start date Start date
M

mcnews

is there an appropriate input mask for datetime fields?
one that prompts with the proper format, but will allow time portion
to be blank or default to all 0s?
 
is there an appropriate input mask for datetime fields?

None, in my opinion. In general input masks just RESTRICT what the user can
type and remove flexibility. If any, then 00/00/00 (for folks who hate to type
slashes) for date-only data, 00/00/00\ 00:00 for hours and minutes in addition
to the date.
one that prompts with the proper format, but will allow time portion
to be blank or default to all 0s?

A Date/Time value is actually stored as a double float number, a count of days
and fractions of a day (times) since midnight, December 30, 1899. As such
there is ALWAYS a time portion; it can't be blank, because blank is a string -
not a number.

A date/time value with zeros past the decimal corresponds to midnight
(00:00:00). You can display it or not as you choose, by using an appropriate
format. What you can't do is have a format which shows times other than
midnight, and blank for midnight.

John W. Vinson [MVP]
 
Back
Top