From 9b780ee8e73271bc18c833d09cc16feca3912aa0 Mon Sep 17 00:00:00 2001 From: duqingquan Date: Fri, 21 Jul 2023 11:59:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20date=20valueof=20=E7=A4=BA?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uni_modules/uts-tests/utssdk/Date.uts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/uni_modules/uts-tests/utssdk/Date.uts b/uni_modules/uts-tests/utssdk/Date.uts index 3465661..8fac465 100644 --- a/uni_modules/uts-tests/utssdk/Date.uts +++ b/uni_modules/uts-tests/utssdk/Date.uts @@ -10,6 +10,12 @@ export function testDate() : Result { expect(secondsElapsed).toEqual(2); }, 2000) }) + test('valueOf', () => { + const date1 = new Date('December 17, 1995 03:24:00'); + expect(date1.valueOf()).toEqual(819141840000); + const date2 = new Date('1995-12-17T03:24:00'); + expect(date2.valueOf()).toEqual(819141840000); + }) test('getDate', () => { const birthday = new Date('August 19, 1975 23:15:30'); const date1 = birthday.getDate(); -- GitLab