Internationalization and localization tools


Locale-Sensitive JavaScript Method

date.getTime();
date.now();

Internationalization (I18n) Method Overview

The getTime method returns a numeric value for the data object, which is the number of milliseconds since January 1, 1970 00:00:00 UTC.

now is equivalent to (new Date()).getTime)

Click here (w3schools) and here (MDN) for additional details.

I18n Issues

Both getTime and setTime may be used to copy dates. If the resulting date object is displayed in the UI then the date object will be displayed using JavaScript's default date format and the system's local time zone. For example, it might be: Wed Sep 10 2014 16:11:22 GMT-0600 (Mountain Daylight Time). This would be incorrect for other locales.

Suggested Replacement

Make sure that when displaying the date, call one of the locale-sensitive date methods, which support setting the time zone as well as using the locale to format the date/time:

Globalyzer will detect this method and report it as an i18n issue. If you have determined that the call is being handled correctly, you can use Globalyzer's Ignore Comment functionality to ensure that it isn't picked up in a subsequent scan.



Locale-Sensitive JavaScript Methods

 

Lingoport internationalization and localization services and software