Quick tip – working with dates with ADODb and MSSQL 2000

Yes, it can be really painfull – MSSQL (at least instance I’m using) is saving date in format “d/m/Y H:i:s” but in every part of code I had “Y-m-d H:i:s”. So what now – rewrite everything? Nope, there is ugly but working way to do it, after ADODb object is created and initialized put:

and that’s it – all dates will be internally converted to given format, so here is full example of config:

Leave a Reply