java.util.Date

java.util
Class Date

java.lang.Object
  java.util.Date
All Implemented Interfaces:
Cloneable, Comparable, Serializable
Direct Known Subclasses:
Date, Time, Timestamp

public class Date extends Object implements Serializable, Cloneable, Comparable

The classDaterepresents a specific instant in time, with millisecond precision.

这个类指定了一个时间,用毫秒表示

Prior to JDK1.1, the classDatehad two additional functions. It allowed the interpretation of dates as year, month, day, hour, minute, and second values. It also allowed the formatting and parsing of date strings. Unfortunately, the API for these functions was not amenable to internationalization. As of JDK1.1, theCalendarclass should be used to convert between dates and time fields and theDateFormatclass should be used to format and parse date strings. The corresponding methods inDateare deprecated.

在jdk1.1前,这个类附加了两个功能,它允许时间有年月日时分和秒的值。它也允许用字符串格式化时间。

不幸地,是它不这些API函数不支持国际化。jdk1.1,calendar类可以用来转换在日期和时间字段,和DateFormat类可以用来转换

时间字符传,对应的方法在date是被定义的

Although theDateclass is intended to reflect coordinated universal time (UTC), it may not do so exactly, depending on the host environment of the Java Virtual Machine. Nearly all modern(现代的) operating systems assume that 1day= 24×60×60= 86400 seconds in all cases. In UTC, however, about once every year or two there is an extra(额外的) second, called a "leap second." The leap second is always added as the last second of the day, and always on December 31 or June 30. For example, the last minute of the year 1995 was 61 seconds long, thanks to an added leap second. Most computer clocks are not accurate enough to be able to reflect the leap-second distinction.

通过这个date类得到的时间,它也许不是精确的,依赖在这java虚拟机。几乎现在的操作时间是:

1day=24x60x60=86400秒。然而,每隔一两年就有额外的秒,它总是加到这天的最后秒上,

和一直在12月的号或者6月的30号,例如,这1995年最后一分钟是61秒长,由于加了跳跃的妙。

大多数计算机的钟都不能精确的反应leap-second的区别

Some computer standards(规定) are defined in terms of Greenwich mean time (GMT)

大多数计算机规定的是格林威治时间

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值