Home
last modified time | relevance | path

Searched full:date (Results 1 – 25 of 251) sorted by relevance

1234567891011

/arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_func_tests/std/time/
DDateChangeTest.sts19 failures += test(testDateChangeYear(), "Try to change date's year");
20 failures += test(testDateChangeMonth(), "Try to change date's month");
21 failures += test(testDateChangeDay(), "Try to set date's new day");
42 let date: Date = new Date();
43 let year = date.getFullYear();
44 date.setFullYear(year - 1);
46 if(date.getFullYear() == (year - 1)) return 0;
52 let tmp = new Date(year, month + 1, 0);
56 function testDateChangeMonthImpl(date: Date, change: int) {
57 let month = date.getMonth();
[all …]
DDateCtorTypes.sts36 let cd = new Date(intYears[i] as long);
37 let cd1 = new Date(intYears[i]);
41 let cd = new Date(intMonths[i] as long);
42 let cd1 = new Date(intMonths[i]);
46 let cd = new Date(intHours[i] as long);
47 let cd1 = new Date(intHours[i]);
51 let cd = new Date(intMinutes[i] as long);
52 let cd1 = new Date(intMinutes[i]);
59 let cd = new Date(doubleYears[i] as double);
60 let cd1 = new Date(doubleYears[i]);
[all …]
DDateConstructorTest.sts36 failures += test(testDateConstructor(), "Test constructor with Date object")
68 let cd = new Date(longYears[i]);
86 let cd = new Date(longYears[i], md[i]);
87 let utc = Date.UTC(longYears[i], md[i]);
106 let cd = new Date(longYears[i], md[i], day);
107 let utc = Date.UTC(longYears[i], md[i], day);
127 let cd = new Date(longYears[i], md[i], day, ht[i]);
128 let utc = Date.UTC(longYears[i], md[i], day, ht[i]);
149 let cd = new Date(longYears[i], md[i], day, ht[i], mh[i]);
150 let utc = Date.UTC(longYears[i], md[i], day, ht[i], mh[i]);
[all …]
DValidDateTest.sts21 let date: Date = new Date(dates[i], 0);
22 let dateComplex = new Date(dates[i], 0);
23 let vd = date.isDateValid();
/arkcompiler/ets_runtime/ecmascript/builtins/
Dbuiltins_date.h22 // List of functions in Date, excluding the '@@' properties.
24 // where BuiltinsDate::func refers to the native implementation of Date[name].
27 … /* Date.now ( ) */ \
29 … /* Date.parse ( string ) */ \
31 … /* Date.UTC ( year [ , month [ , date [ , hours [ , minutes [ , seconds [ , ms ] ] ] ] ] ] ) */ \
34 // List of functions in Date.prototype, excluding the constructor and '@@' properties.
36 // where BuiltinsDate::func refers to the native implementation of Date.prototype[name].
38 /* Date.prototype.getDate ( ) */ \
40 /* Date.prototype.getDay ( ) */ \
42 /* Date.prototype.getFullYear ( ) */ \
[all …]
Dbuiltins_date.cpp36 BUILTINS_API_TRACE(argv->GetThread(), Date, Constructor); in DateConstructor()
52 if (value->IsDate()) { // The value is a date object. in DateConstructor()
87 BUILTINS_API_TRACE(argv->GetThread(), Date, Now); in Now()
94 BUILTINS_API_TRACE(argv->GetThread(), Date, Parse); in Parse()
102 BUILTINS_API_TRACE(argv->GetThread(), Date, UTC); in UTC()
111 BUILTINS_API_TRACE(argv->GetThread(), Date, GetTime); in GetTime()
116 THROW_TYPE_ERROR_AND_RETURN(thread, "Not a Date Object", JSTaggedValue::Exception()); in GetTime()
124 BUILTINS_API_TRACE(argv->GetThread(), Date, SetTime); in SetTime()
130 THROW_TYPE_ERROR_AND_RETURN(thread, "Not a Date Object", JSTaggedValue::Exception()); in SetTime()
145 BUILTINS_API_TRACE(argv->GetThread(), Date, ToJSON); in ToJSON()
[all …]
/arkcompiler/ets_runtime/test/perform/string/
Dstring.js18 const time1 = Date.now()
22 const time2 = Date.now()
31 const time1 = Date.now()
35 const time2 = Date.now()
44 const time1 = Date.now()
48 const time2 = Date.now()
55 const time1 = Date.now()
59 const time2 = Date.now()
66 const time1 = Date.now()
70 const time2 = Date.now()
[all …]
/arkcompiler/ets_runtime/test/aottest/builtin_inlining/date/Now/
DbuiltinDateNow.ts27 return Date.now(x);
31 return Date.now();
49 //aot: [trace] aot inline builtin: Date.now, caller function name:func_main_0@builtinDateNow
50 print(Date.now()); //: __INT__
58 //aot: [trace] aot inline builtin: Date.now, caller function name:func_main_0@builtinDateNow
59 print(Date.now()); //: __INT_MORE_PREV__
65 //aot: [trace] aot inline builtin: Date.now, caller function name:func_main_0@builtinDateNow
66 print(Date.now(0)); //: __INT__
67 //aot: [trace] aot inline builtin: Date.now, caller function name:func_main_0@builtinDateNow
68 print(Date.now(1, 2)); //: __INT__
[all …]
/arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_es_checked/
Ddate.yaml14 category: Date
16 - expr: new Date(pars).getTimezoneOffset()
24 - expr: new Date(pars).valueOf()
32 - expr: new Date(pars).getFullYear()
35 - expr: new Date(pars).getMonth()
38 - expr: new Date(pars).getDate()
41 - expr: new Date(pars).getDay()
44 - expr: new Date(pars).getHours()
47 - expr: new Date(pars).getMinutes()
50 - expr: new Date(pars).getSeconds()
[all …]
/arkcompiler/runtime_core/static_core/plugins/ets/stdlib/escompat/
DDate.sts18 // TODO To offer protection against timing attacks and fingerprinting, the precision of `Date.getTi…
19 // `Date.now()` might get rounded depending on browser (target) settings.
165 * @returns Date number (within month).
300 * @param date
304 function ecmaMakeDay(year: long, month: long, date: long): long {
312 …DayFromYear(ym) as long + getFirstDayInMonth(ecmaInLeapYear(ym), mn) as long + (date as long) - 1);
402 * Date JS API-compatible class
404 export final class Date {
405 /** Stored value of Date, milliseconds */
410 * The `parseDateFromString()` static method parses a string representation of a date,
[all …]
/arkcompiler/ets_runtime/test/aottest/builtin_inlining/date/GetTime/
DbuiltinDateGetTime.ts48 let time = new Date('July 20, 99 20:17:40 GMT+00:00')
49 //aot: [trace] aot inline builtin: Date.prototype.getTime, caller function name:func_main_0@builtin…
52 time = new Date(990000000000)
53 //aot: [trace] aot inline builtin: Date.prototype.getTime, caller function name:func_main_0@builtin…
55 //aot: [trace] aot inline builtin: Date.prototype.getTime, caller function name:func_main_0@builtin…
59 time = new Date(1990, 2, 15, 16, 17, 18);
60 //aot: [trace] aot inline builtin: Date.prototype.getTime, caller function name:func_main_0@builtin…
62 //aot: [trace] aot inline builtin: Date.prototype.getTime, caller function name:func_main_0@builtin…
64 //aot: [trace] aot inline builtin: Date.prototype.getTime, caller function name:func_main_0@builtin…
66 //aot: [trace] aot inline builtin: Date.prototype.getTime, caller function name:func_main_0@builtin…
[all …]
/arkcompiler/ets_runtime/test/perform/number/
Dnumber.js17 let start = Date.now();
22 let end = Date.now();
29 let start = Date.now();
34 let end = Date.now();
41 let start = Date.now();
46 let end = Date.now();
54 const time1 = Date.now()
58 const time2 = Date.now()
64 let start = Date.now();
69 let end = Date.now();
[all …]
/arkcompiler/ets_frontend/ets2panda/test/parser/ets/
Dglobal_const_vars3.sts17 const dae: Date = new Date();
20 public readonly date: Date;
23 this.date = new Date();
/arkcompiler/ets_frontend/ets2panda/test/ast/parser/ets/
Dglobal_const_vars4.sts17 public readonly date: Date = new Date();
24 this.date = new Date();
30 /* @@? 17:21 Error TypeError: Cannot assign to a readonly variable date */
Dglobal_const_vars1.sts16 const date: Date = new Date();
/arkcompiler/ets_runtime/test/moduletest/datecase/
Ddatecase.js18 * @tc.desc:test date
22 var d1 = new Date(2022, 0, 1);
23 var d2 = new Date(2022, 1, 2);
24 var d3 = new Date(2022, 2, 3);
25 var d4 = new Date(2022, 3, 4);
26 var d5 = new Date(1677628800000);
27 var d6 = new Date(1680278400000);
29 var d9 = new Date(1970, 1, 1);
30 var d10 = new Date(2022, 2, 26, 23, 59); // dst become effective in GMT+02:00
/arkcompiler/ets_runtime/test/moduletest/dateparse/
Ddateparse.js18 * @tc.desc:test date
22 var d1 = new Date("2023-02-19T11:13:48.132Z");
23 var d2 = new Date("Thu Nov 19 2020 20:18:18 GMT");
24 var d3 = new Date("Thu, 21 Nov 2023 13:23:26 GMT");
25 var d4 = new Date("2021-12-25 03:25:45.476Z");
26 var d5 = new Date("January 13,2016 22:19:35 GMT");
51 let d6 = new Date("Wed, 26-Jun-19 GMT")
53 let d7 = new Date("Wed, 26-Jun-2019 GMT")
55 let date8=new Date('Jun,19 12:03:45 GMT')
/arkcompiler/ets_runtime/ecmascript/
Djs_date.cpp33 void DateUtils::TransferTimeToDate(int64_t timeMs, std::array<int64_t, DATE_LENGTH> *date) in TransferTimeToDate() argument
35 …(*date)[HOUR] = Mod(timeMs, MS_PER_DAY); // ms from hour, minutes,… in TransferTimeToDate()
36 …(*date)[DAYS] = (timeMs - (*date)[HOUR]) / MS_PER_DAY; // days from year, month,… in TransferTimeToDate()
37 (*date)[MS] = (*date)[HOUR] % MS_PER_SECOND; // ms in TransferTimeToDate()
38 …(*date)[HOUR] = ((*date)[HOUR] - (*date)[MS]) / MS_PER_SECOND; // s from hour, minutes, … in TransferTimeToDate()
39 (*date)[SEC] = (*date)[HOUR] % SEC_PER_MINUTE; // second in TransferTimeToDate()
40 … (*date)[HOUR] = ((*date)[HOUR] - (*date)[SEC]) / SEC_PER_MINUTE; // min from hour, minutes in TransferTimeToDate()
41 (*date)[MIN] = (*date)[HOUR] % SEC_PER_MINUTE; // min in TransferTimeToDate()
42 (*date)[HOUR] = ((*date)[HOUR] - (*date)[MIN]) / SEC_PER_MINUTE; // hour in TransferTimeToDate()
43 (*date)[WEEKDAY] = Mod(((*date)[DAYS] + LEAP_NUMBER[0]), DAY_PER_WEEK); // weekday in TransferTimeToDate()
[all …]
/arkcompiler/ets_runtime/test/moduletest/datecompare/
Ddatecompare.js18 * @tc.desc:test date
22 var str1 = Date.parse('08/04/2011')
23 var str2 = Date.parse('2010-08-04')
25 var timer1 = new Date(str1)
26 var timer2 = new Date(str2)
/arkcompiler/ets_frontend/arkguard/test/grammar/interface_validation/
Dinterface_class_method.ts19 currentTime: Date;
21 setTime(d: Date);
25 currentTime: Date;
27 setTime(d: Date) {
37 let now = Date.prototype;
/arkcompiler/ets_runtime/test/moduletest/builtins/
Dbuiltinsir.js26 print(str1.charCodeAt(new Date()));
58 a.foo = Date;
63 date: Date, property
72 obj.date(0);
73 obj.date(0, 1);
74 obj.date(0, 1, 2);
75 obj.date(0, 1, 2, 3);
/arkcompiler/ets_frontend/arkguard/test/grammar/date_validation/
Ddate_tojson.ts18 let date = new Date(); variable
20 const dateJson = date.toJSON();
22 const dateStr = date.toISOString();
/arkcompiler/ets_runtime/test/aottest/formatrangetoparts/
Dformatrangetoparts.js31 // Switch to a time format instead of using DateTimeFormat's default date-only format.
35 const date = Date.now(); constant
36 const expected = dtf.formatRangeToParts(0, date);
38 compare(dtf.formatRangeToParts(-0.9, date), expected, "formatRangeToParts(-0.9)");
/arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_func_tests/koala-related-benchmarks/
Dbenchmark-lambda-no-lambda-modified.sts51 start = Date.now()
55 console.log("lambda time: " + (Date.now() - start))
60 start = Date.now()
64 console.log("no lambda time: " + (Date.now() - start))
/arkcompiler/runtime_core/static_core/plugins/ets/tests/micro-benchmarks/wrapper/
Dtest_wrapper.pa16 .record escompat.Date <external>
19 .function f64 escompat.Date.now() <external>
41 call.short escompat.Date.now
57 call.short escompat.Date.now

1234567891011