13.07.2015 Views

The wxPython tutorial

The wxPython tutorial

The wxPython tutorial

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Internationalizationhttp://www.zetcode.com/wxpython/in18/self.dt = wx.DateTime()Here we create a wx.DateTime object.now = self.dt.Now()We get the "absolute moment" in time.self.tokyo.SetLabel('Tokyo: ' + str(now.Format(('%a %T'),wx.DateTime.GMT_9)))This code line sets the time to the appropriate format. <strong>The</strong> %aconversion specifier is an abbreviated weekday name accordingto the current locale. <strong>The</strong> %T is the time of day using decimalnumbers using the format %H:%M:%S. <strong>The</strong> second parameterof the Format() method specifies the time zone. GMT_9 is usedfor Japan, EDT (Eastern Daylight Saving Time) is used in NewYork etc.<strong>The</strong> code example was checked with the timeanddate.comwebsite.Figure: World TimeSortingLocale settings also affect the way, how strings are being sorted.7 de 12 27/04/2008 1:06

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!