Jump to content

mysql time format


project3

Recommended Posts

I have a db table that has field with the TIME for the field type. I do some between statements with the sql statements to pull results.

 

like $time_now between open and close;

 

what happens is there are different time periods allowing each place to have 3 sets of open times each day.

 

like

open  close

10:00  12:00

14:00  18:00

19:00  21:00

 

well everything works fine for finding the open places but I want to show places that are closed

and have them shadowed.

 

so what i did was a not between.

 

but say a place only has one set of open times.

because the time field puts 00:00:00 during the periods that are not filled in.

 

the not between wont work because not between 00:00 and 00:00 makes the result

show up on all of them.

 

so I was wondering how I can get this to work. I thought about changing the field to varchar

but im not sure that I could still do the time  comparisons if its not time. and if the ones not

filled in were blank and not 00:00 I think it would still come up in not between.

 

Any help here would be greatly appreciated.

Link to comment
https://forums.phpfreaks.com/topic/95456-mysql-time-format/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.