As the previous post mentioned, I'm assuming that is a unix timestamp.
The module you want to use is datetime.

import datetime
mysql_date = datetime.datetime.fromtimestamp(1219848914)

mysql_date can be save directly to a datetime model field. However, if
you are wanting the date formatted as you provided, the last step
would be:

mysql_date.strftime("%d-%m-%y")

R.


On May 22, 2:13 am, laspal <amit.las...@gmail.com> wrote:
> Hi,
>
> How to convert mysql 10 digit date format to django date format?
> example:
> mysql date - 1219848914
> to django date - "22-05-09"
>
> thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to