开发者

Django Time issues

My app in django requires to tell the user what time an action occurred. Aside from asking the user what timezo开发者_如何学Gone he/she is in, is it possible for me to generate the time on the client end?

Off the top of my head, are there a particular representation of time that is timezone independent, (unix time?), and then I can simply paste it into the html and have the client end (browser) findout the timezone and then do the calculation?


I'd make all my times UTC, as that's a good international-level reference point, and you can always shift that to a local time, given that you know the user's TZ.

I'd also use the time on the server (datetime.datetime.now()) rather than rely on the client's system clock, as this makes it easy to fake what time something happened at.


Haven't used it myself, but I think this is what you are looking for.


i think you are looking for L10n (localization) yes ???

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜