Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Re: [hennagaijin] date formats

Quote Reply
Re: [hennagaijin] date formats In reply to
Why not use a regular expression to control what the user can add to your database.

I use the following date/time format -

2002-10-30 23:04:52

and the following regular expression -

[0-9]{4}\-[0-9]{2}\-[0-9]{2}\s[0-9]{2}\:[0-9]{2}\:[0-9]{2}

which means that the date time format must be xxxx-xx-xx xx:xx:xx or the user cannot add it to the database. I'm new to regular expressions so there is probably a better way to write it but the above example seems to work fine.

Take a look at page 86-88 of the new DBMan SQL manual.

Simon.
Subject Author Views Date
Thread date formats hennagaijin 4210 Oct 30, 2002, 6:51 PM
Thread Re: [hennagaijin] date formats
jai 4052 Oct 30, 2002, 8:38 PM
Thread Re: [jai] date formats
hennagaijin 4032 Oct 31, 2002, 5:23 AM
Post Re: [hennagaijin] date formats
jaspercram 3992 Nov 1, 2002, 2:52 AM