> Den 21. sep. 2016 kl. 02.41 skrev sum abiut <suab...@gmail.com>:
> Thanks Erik, 
> i think that should do the trick.is there a way to covert the date column 
> straight from the sql query or from the template?

If you want to do this from the template, create a custom template tag: 

I don't have experience with MSSQL, but if you want to convert the date 
server-side, this should work: 
 You could add the custom SQL as a RawSQL: 

Depending on how your data is represented, you could also solve this with a 
custom model field: 
https://docs.djangoproject.com/en/1.10/howto/custom-model-fields/ The 
conversion code should go in the from_db_value() method.


You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
For more options, visit https://groups.google.com/d/optout.

Reply via email to