Effectivement les dates sont toujours un problème. Que ce soit en .NET ou autre language ou en SQL. Le principal problème est le formatage. Comment en SQL envoyer le bon format ? aaaa/mm/jj ou jj/mm/aaaa ou mm/jj/aaaa ? Ce problème est réel et encore plus quand vous faites des reqàªtes sur des systèmes distant par Webservice ou autre.
La solution est d’utiliser des différence de date avec les fonctions serveurs. Par exemple en sql utilisé GetDate() avec un soustraction de x soit GetDate()-1 ou autre.

Bonne programmation


DateTime data are always a problem to manage. Either in .NET or PHP or SQL (T-SQL). The real problem is event bigger when you didn’t know the date format of the remote computer. Is it yyyy/mm/dd or dd/mm/yy ? It also possible that the remote system (WebService or Client) will change it regional setting to put other formating.

The solution is to use the time on the server. For exemple in SQL use GetDate() witrh a substraction number.

Happy programming