Storing dates

speakers_86

Registered User.
Local time
Today, 11:59
Joined
May 17, 2007
Messages
1,919
Should date and time fields be split up? An end user is not going to know that after using the date picker the time can be added to the same box. I think if date and time are split up, it will be more user friendly. So, should they be seperate? If so, how would it look at the table level, and how do you bring them together?
 
In general, on a table, there should be one field per entry.

For example:

first name is one field
last name is another
d.o.b. is another

and so on. Having a field that has multiple items in it can cause problems later on down the road.
 
i can see some sense in splitting dates and times to be honest, although it isn't strictly necessary

think about outlook. you get a lot of entries on a calendar for a given date, which are then shown in time slots. So how do they do that? does the diary entry store the date and time in a single field - or does it store the date as an integer, and then store the time as a different field altogether. it may do either.

Times aren't really susceptible to a concise time picker, in a way that dates are - which makes dealing with times somewhat awkward.

It's a matter of taste, i suspect.


to take this a bit further - depending how you want to manipulate the times, may affect the way you need to store them. Im some apps, I just make the users enter a 2400 clock time, and force them to enter 4 characters such as 0800, and then store this as a text string

it's very easy to validate, and easy for users to input.
 
Last edited:
Since the storage of a date or time includes a zero time or date why not just store the date and time together, it is usually easier to separate them if required rather than join them

Brian
 
Since the storage of a date or time includes a zero time or date why not just store the date and time together, it is usually easier to separate them if required rather than join them

Brian

I was only asking this to try and get better input from users. After selecting the date with the date picker, who is going to try and put in the time? No one would even think of trying. It seems to me like there should be a control on the form for date, and a control on the form for time. I'm not trying to say they need to be STORED seperately, only ENTERED seperately.
 

Users who are viewing this thread

Back
Top Bottom