Date toString methods follow the date format used by other JS engines:

new Date(0).toString () == "Thu Jan 01 1970 00:00:00 GMT+0000"
new Date(0).toUTCString () == "Thu, 01 Jan 1970 00:00:00 GMT"
new Date(0).toISOString () == "1970-01-01T00:00:00.000Z"

Fixes S15.5.4.7_A1_T11.js test case.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg@inf.u-szeged.hu
This commit is contained in:
Zoltan Herczeg
2015-08-13 03:54:49 -07:00
parent 4ee30cba5d
commit 5be41b44bb
6 changed files with 237 additions and 31 deletions
@@ -476,7 +476,7 @@ ecma_builtin_date_dispatch_call (const ecma_value_t *arguments_list_p __attr_unu
ecma_builtin_date_now (ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED)),
ret_value);
ret_value = ecma_date_value_to_string (*ecma_get_number_from_value (now_val), ECMA_DATE_LOCAL);
ret_value = ecma_date_value_to_string (*ecma_get_number_from_value (now_val));
ECMA_FINALIZE (now_val);