Home  >  Article  >  Web Front-end  >  简介JavaScript中toTimeString()方法的使用_基础知识

简介JavaScript中toTimeString()方法的使用_基础知识

WBOY
WBOYOriginal
2016-05-16 15:55:201089browse

 该方法返回一个Date对象在人类可读的形式时间部分。
语法

Date.toTimeString()

下面是参数的详细信息:

  •     NA

返回值:

返回Date对象的人类可读形式的时间部分。
例子:

<html>
<head>
<title>JavaScript toTimeString Method</title>
</head>
<body>
<script type="text/javascript">
  var dateobject = new Date(1993, 6, 28, 14, 39, 7);
  document.write( dateobject.toTimeString() ); 
</script>
</body>
</html>

这将产生以下结果:

14:39:07 UTC+0530 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn