diff --git a/uni_modules/uts-tests/utssdk/Date.uts b/uni_modules/uts-tests/utssdk/Date.uts index 8fac465f9a24da3e21c9f6f157ee445ae2a2e950..d5c734b6723fbef325715c17a555b7a76ab1c047 100644 --- a/uni_modules/uts-tests/utssdk/Date.uts +++ b/uni_modules/uts-tests/utssdk/Date.uts @@ -16,6 +16,13 @@ export function testDate() : Result { const date2 = new Date('1995-12-17T03:24:00'); expect(date2.valueOf()).toEqual(819141840000); }) + test('parse', () => { + const unixTimeZero = Date.parse('01 Jan 1970 00:00:00 GMT'); + const javaScriptRelease = Date.parse('04 Dec 1995 00:12:00 GMT'); + + expect(unixTimeZero.toString()).toEqual("Thu Jan 01 1970 08:00:00 GMT+0800"); + expect(javaScriptRelease.toString()).toEqual("Mon Dec 04 1995 08:12:00 GMT+0800"); + }) test('getDate', () => { const birthday = new Date('August 19, 1975 23:15:30'); const date1 = birthday.getDate();