Posted by & filed under FreeTDS, Vagrant.

I have a server that gives me datetime strings as:

2015-11-17 08:00:12.123

and a Vagrant instance that gives me:

Nov 17 2015 08:00:12

To get the first format on the Vagrant instance I created a /etc/freetds/locales.conf file and added:

date format = %Y-%m-%d %H:%M:%S.%z

to it. Then I edited the /etc/freetds/freetds.conf file and added the following to the [default] block:

date format = %Y-%m-%d %H:%M:%S.%z

and then I changed the tds version in the file to 7.0. A quick restart of the web server and I am enjoying consistent datetime formatting from development to production.

One Response to “FreeTDS DateTime Formatting Issue”

  1. Francisco Daniel


    Thanks for your post! Works like a charm!

    Greetings from Mexico!


What do you really think?