How to Get Localized Month and Week Names in Tizen

Original Created Apr 26, 2016 | Regeneration Apr 22, 2026

What is the best way to retrieve localized week names (e.g., Monday or MON) and month names (e.g., January or JAN) in Tizen applications?

I couldn't find relevant functions in the TZDate class. Are there any recommended approaches or alternative methods to achieve this localization?

Problem Understanding

The user needs to display month and week names in different languages and formats (full name or abbreviation) within a Tizen application. While TZDate provides basic date functionality, it lacks direct methods for retrieving localized month and week names.

Solution Methods

  1. Using Tizen's Localization System: Tizen provides comprehensive localization support through its iLib library. You can use this to get localized month and week names.

  2. Web Application Localization: For web applications, you can utilize JavaScript's built-in Intl.DateTimeFormat API which is supported in Tizen web runtime.

Code Examples

Native Application Example (using iLib):

// For month names
var monthNames = new iLib.DateFormat({
    type: "date",
    date: "m",
    length: "full" // or "short" for abbreviations
}).format(new Date());

// For weekday names
var weekdayNames = new iLib.DateFormat({
    type: "date",
    date: "w",
    length: "full" // or "short" for abbreviations
}).format(new Date());

Web Application Example:

// For month names
const monthFormatter = new Intl.DateTimeFormat(undefined, { month: 'long' }); // or 'short'
const monthName = monthFormatter.format(new Date());

// For weekday names
const weekdayFormatter = new Intl.DateTimeFormat(undefined, { weekday: 'long' }); // or 'short'
const weekdayName = weekdayFormatter.format(new Date());

Additional Tips

  • Remember to include the proper locale when formatting dates to ensure correct localization.
  • For web applications, test your implementation across different browsers as Intl support might vary.
  • Consider caching formatted dates if you need to display them frequently to improve performance.

Customize your cookie preferences

You can enable or disable non-essential cookies. Essential cookies are always on to ensure the site works properly and to keep you signed in.

Necessary

These cookies are necessary for the website to function properly and cannot be switched off. They help with things like logging in and setting your privacy preferences.

Always on

Analytics

These cookies help us improve the site by tracking which pages are most popular and how visitors move around the site.

Enable analytics cookies
Public Forum Public Forum
Employees only. Please sign in with your company account.