This page was last modified 09:16, 25 March 2008.
CS000857 - I18n: Timestamps
From Forum Nokia Wiki
| ID | CS000857 | Creation date | March 25, 2008 |
| Platform | S60 3rd Edition, MR S60 3rd Edition, FP1 S60 3rd Edition, FP2 Beta | Tested on devices | Nokia E61i Nokia E90 Communicator Nokia N95 8GB Nokia 6220 Classic |
| Category | Symbian C++ | Subcategory | Localization |
| APIs | None | Classes | TTime |
| Methods | TTime::FormatL() |
Overview
This code snippet is one of the series of snippets that demonstrate how to implement support for international diversity. This snippet shows how to format a timestamp according to the locale settings of the device.
Source file
// Buffer for localized text TBuf<50> myBuf; // Object for datetime data TTime myTime; // Set the date and time of myTime to the current datetime myTime.HomeTime(); // Format the timestamp as date according to current locale settings // The format string is universal, so whatever the locale is, the date is // always formatted correctly (e.g. 03/03/2008) myTime.FormatL(myBuf, _L("%/0%1%/1%2%/2%3%/3%X")); // Format the timestamp as time according to current locale settings // The format string is universal, so whatever the locale is, the time is // always formatted correctly (e.g. 13:00 pm) myTime.FormatL(myBuf, _L("%-B%:0%J%:1%T%:2%S%:3%+B"));
Postconditions
A timestamp is formatted according to the locale settings of the device.
See also
- CS000855 - I18n: Real numbers
- CS000856 - I18n: Currency
- CS000858 - I18n: Images
- CS000807 - Localizing application strings
- S60 Platform: Localization Example
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Reading a multilangual file - A DETAILED SOLUTION + a Hebrew example | dd_plus | Mobile Java General | 13 | 2007-12-07 11:21 |
| how to create and access resource file in j2me | jackofall | Mobile Java General | 4 | 2008-02-29 21:48 |
| Ask the Expert: Risalmin on Web Runtime and Flash | Nokia Ron | Flash Lite on Nokia Devices | 0 | 2008-03-31 18:49 |
| How do I view .rss compile errors | mribble | Carbide.c++ and CodeWarrior Tools | 5 | 2006-10-12 15:33 |
| Pjava on the 9210 Communicator | quintel | PersonalJava | 0 | 2004-06-16 08:27 |

