本文整理汇总了Python中__pyjamas__.JS.toLocaleString方法的典型用法代码示例。如果您正苦于以下问题:Python JS.toLocaleString方法的具体用法?Python JS.toLocaleString怎么用?Python JS.toLocaleString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类__pyjamas__.JS
的用法示例。
在下文中一共展示了JS.toLocaleString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: JS
# 需要导入模块: from __pyjamas__ import JS [as 别名]
# 或者: from __pyjamas__.JS import toLocaleString [as 别名]
# Check http://docs.python.org/library/time.html
from __pyjamas__ import JS
import math
timezone = JS("60 * (new Date(new Date().getFullYear(), 0, 1)).getTimezoneOffset()")
altzone = JS("60 * (new Date(new Date().getFullYear(), 6, 1)).getTimezoneOffset()")
if altzone > timezone:
# Probably on southern parth of the earth...
d = timezone
timezone = altzone
altzone = d
_dst = timezone - altzone
d = JS("(new Date(new Date().getFullYear(), 0, 1))")
d = str(d.toLocaleString()).split()[-1]
if d[0] == '(':
d = d[1:-1]
tzname = (d, None)
del d
__c__days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
__c__months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
def time():
return float(JS("new Date().getTime() / 1000.0"))
class struct_time(object):
n_fields = 9
n_sequence_fields = 9
n_unnamed_fields = 0