Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

把日期转换为毫秒值得最简单写法 #27

Open
mishe opened this issue Dec 2, 2015 · 0 comments
Open

把日期转换为毫秒值得最简单写法 #27

mishe opened this issue Dec 2, 2015 · 0 comments

Comments

@mishe
Copy link
Owner

mishe commented Dec 2, 2015

1,一般的写法:

var date=new Date();

date.getTime()

2.改进的写法

new Date().getime()

3.最简洁的写法

+new Date

但是这个写法在JS压缩时会出错。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant