toISO_2.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. runTest(new Date(-3260000000000000));
  6. runTest(new Date(-860000000000000));
  7. runTest(new Date(-62167219200001));
  8. runTest(new Date(3260000000000000));
  9. runTest(new Date(860000000000000));
  10. runTest(new Date(-61167219200001));
  11. runTest(new Date(-62140000000000));
  12. function runTest(d)
  13. {
  14. writeLine(d.toJSON());
  15. }
  16. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  17. // Helpers
  18. function writeLine(str)
  19. {
  20. WScript.Echo("" + str);
  21. }
  22. function safeCall(func)
  23. {
  24. try
  25. {
  26. return func();
  27. }
  28. catch (ex)
  29. {
  30. writeLine(ex.name + ": " + ex.message);
  31. }
  32. }