mirror of
https://gitee.com/dromara/carbon.git
synced 2024-12-03 12:48:22 +08:00
Merge branch 'v2'
This commit is contained in:
commit
440103c39c
15
README.cn.md
15
README.cn.md
@ -640,17 +640,8 @@ carbon.Parse("2020-07-05 13:14:15").SetLocale("en").DiffForHumans() // 1 month a
|
||||
carbon.Parse("2020-07-05 13:14:15").SetLocale("zh-CN").DiffForHumans() // 1 月前
|
||||
|
||||
// 设置年月日时分秒
|
||||
carbon.Parse("2020-01-01").SetDateTime(2019, 2, 2, 13, 14, 15).ToString() // 2019-02-02 13:14:15 +0800 CST
|
||||
carbon.Parse("2020-01-01").SetDateTime(2019, 2, 31, 13, 14, 15).ToString() // 2019-03-03 13:14:15 +0800 CST
|
||||
// 设置年月日时分秒毫秒
|
||||
carbon.Parse("2020-01-01").SetDateTimeMilli(2019, 2, 2, 13, 14, 15, 999).ToString() // 2019-02-02 13:14:15.999 +0800 CST
|
||||
carbon.Parse("2020-01-01").SetDateTimeMilli(2019, 2, 31, 13, 14, 15, 999).ToString() // 2019-03-03 13:14:15.999 +0800 CST
|
||||
// 设置年月日时分秒微秒
|
||||
carbon.Parse("2020-01-01").SetDateTimeMicro(2019, 2, 2, 13, 14, 15, 999999).ToString() // 2019-02-02 13:14:15.999999 +0800 CST
|
||||
carbon.Parse("2020-01-01").SetDateTimeMicro(2019, 2, 31, 13, 14, 15, 999999).ToString() // 2019-03-03 13:14:15.999999 +0800 CST
|
||||
// 设置年月日时分秒纳秒
|
||||
carbon.Parse("2020-01-01").SetDateTimeNano(2019, 2, 2, 13, 14, 15, 999999999).ToString() // 2019-02-02 13:14:15.999999999 +0800 CST
|
||||
carbon.Parse("2020-01-01").SetDateTimeNano(2019, 2, 31, 13, 14, 15, 999999999).ToString() // 2019-03-03 13:14:15.999999999 +0800 CST
|
||||
carbon.Parse("2020-01-01").SetDateTime(2019, 2, 2, 13, 14, 15).ToDateTimeString() // 2019-02-02 13:14:15
|
||||
carbon.Parse("2020-01-01").SetDateTime(2019, 2, 31, 13, 14, 15).ToDateTimeString() // 2019-03-03 13:14:15
|
||||
|
||||
// 设置年月日
|
||||
carbon.Parse("2020-01-01").SetDate(2019, 2, 2).ToDateTimeString() // 2019-02-02 00:00:00
|
||||
@ -694,7 +685,7 @@ carbon.Parse("2020-08-05 13:14:15").SetSecond(60).ToDateTimeString() // 2020-08-
|
||||
carbon.Parse("2020-08-05 13:14:15").SetMillisecond(100).Millisecond() // 100
|
||||
carbon.Parse("2020-08-05 13:14:15").SetMillisecond(999).Millisecond() // 999
|
||||
|
||||
// 设置微秒
|
||||
// 设置微妙
|
||||
carbon.Parse("2020-08-05 13:14:15").SetMicrosecond(100000).Microsecond() // 100000
|
||||
carbon.Parse("2020-08-05 13:14:15").SetMicrosecond(999999).Microsecond() // 999999
|
||||
|
||||
|
19
README.jp.md
19
README.jp.md
@ -161,15 +161,17 @@ carbon.Parse("0000-00-00").ToDateTimeString() // 空の文字列
|
||||
carbon.Parse("00:00:00").ToDateTimeString() // 空の文字列
|
||||
|
||||
carbon.Parse("2020-08-05").ToString() // 2020-08-05 00:00:00 +0800 CST
|
||||
carbon.Parse("20200805").ToString() // 2020-08-05 00:00:00 +0800 CST
|
||||
carbon.Parse("2020-08-05 13:14:15").ToString() // 2020-08-05 13:14:15 +0800 CST
|
||||
carbon.Parse("2020-08-05 13:14:15.999").ToString() // 2020-08-05 13:14:15.999 +0800 CST
|
||||
carbon.Parse("2020-08-05 13:14:15.999999").ToString() // 2020-08-05 13:14:15.999999 +0800 CST
|
||||
carbon.Parse("2020-08-05 13:14:15.999999999").ToString() // 2020-08-05 13:14:15.999999999 +0800 CST
|
||||
|
||||
carbon.Parse("2020-08-05T13:14:15+08:00").ToString() // 2020-08-05 13:14:15 +0800 CST
|
||||
carbon.Parse("2020-08-05T13:14:15.999+08:00").ToString() // 2020-08-05 13:14:15.999 +0800 CST
|
||||
carbon.Parse("2020-08-05T13:14:15.999999+08:00").ToString() // 2020-08-05 13:14:15.999999 +0800 CST
|
||||
carbon.Parse("2020-08-05T13:14:15.999999999+08:00").ToString() // 2020-08-05 13:14:15.999999999 +0800 CST
|
||||
|
||||
carbon.Parse("20200805").ToString() // 2020-08-05 00:00:00 +0800 CST
|
||||
carbon.Parse("20200805131415").ToString() // 2020-08-05 13:14:15 +0800 CST
|
||||
carbon.Parse("20200805131415.999").ToString() // 2020-08-05 13:14:15.999 +0800 CST
|
||||
carbon.Parse("20200805131415.999999").ToString() // 2020-08-05 13:14:15.999999 +0800 CST
|
||||
@ -635,17 +637,8 @@ carbon.Parse("2020-07-05 13:14:15").SetLocale("en").DiffForHumans()) // 1 month
|
||||
carbon.Parse("2020-07-05 13:14:15").SetLocale("zh-CN").DiffForHumans() // 1 月前
|
||||
|
||||
// 年月日時分秒を設定する
|
||||
carbon.Parse("2020-01-01").SetDateTime(2019, 2, 2, 13, 14, 15).ToString() // 2019-02-02 13:14:15 +0800 CST
|
||||
carbon.Parse("2020-01-01").SetDateTime(2019, 2, 31, 13, 14, 15).ToString() // 2019-03-03 13:14:15 +0800 CST
|
||||
// 年月日時分秒ミリ秒を設定する
|
||||
carbon.Parse("2020-01-01").SetDateTimeMilli(2019, 2, 2, 13, 14, 15, 999).ToString() // 2019-02-02 13:14:15.999 +0800 CST
|
||||
carbon.Parse("2020-01-01").SetDateTimeMilli(2019, 2, 31, 13, 14, 15, 999).ToString() // 2019-03-03 13:14:15.999 +0800 CST
|
||||
// 年月日時分秒微秒を設定する
|
||||
carbon.Parse("2020-01-01").SetDateTimeMicro(2019, 2, 2, 13, 14, 15, 999999).ToString() // 2019-02-02 13:14:15.999999 +0800 CST
|
||||
carbon.Parse("2020-01-01").SetDateTimeMicro(2019, 2, 31, 13, 14, 15, 999999).ToString() // 2019-03-03 13:14:15.999999 +0800 CST
|
||||
// 年月日時分秒ナノ秒を設定する
|
||||
carbon.Parse("2020-01-01").SetDateTimeNano(2019, 2, 2, 13, 14, 15, 999999999).ToString() // 2019-02-02 13:14:15.999999999 +0800 CST
|
||||
carbon.Parse("2020-01-01").SetDateTimeNano(2019, 2, 31, 13, 14, 15, 999999999).ToString() // 2019-03-03 13:14:15.999999999 +0800 CST
|
||||
carbon.Parse("2020-01-01").SetDateTime(2019, 2, 2, 13, 14, 15).ToDateTimeString() // 2019-02-02 13:14:15
|
||||
carbon.Parse("2020-01-01").SetDateTime(2019, 2, 31, 13, 14, 15).ToDateTimeString() // 2019-03-03 13:14:15
|
||||
|
||||
// 年月日を設定する
|
||||
carbon.Parse("2020-01-01").SetDate(2019, 2, 2).ToDateTimeString() // 2019-02-02 00:00:00
|
||||
@ -689,7 +682,7 @@ carbon.Parse("2020-08-05 13:14:15").SetSecond(60).ToDateTimeString() // 2020-08-
|
||||
carbon.Parse("2020-08-05 13:14:15").SetMillisecond(100).Millisecond() // 100
|
||||
carbon.Parse("2020-08-05 13:14:15").SetMillisecond(999).Millisecond() // 999
|
||||
|
||||
// 微秒に設定
|
||||
// 微妙に設定
|
||||
carbon.Parse("2020-08-05 13:14:15").SetMicrosecond(100000).Microsecond() // 100000
|
||||
carbon.Parse("2020-08-05 13:14:15").SetMicrosecond(999999).Microsecond() // 999999
|
||||
|
||||
|
17
README.md
17
README.md
@ -164,15 +164,17 @@ carbon.Parse("0000-00-00").ToDateTimeString() // empty string
|
||||
carbon.Parse("00:00:00").ToDateTimeString() // empty string
|
||||
|
||||
carbon.Parse("2020-08-05").ToString() // 2020-08-05 00:00:00 +0800 CST
|
||||
carbon.Parse("20200805").ToString() // 2020-08-05 00:00:00 +0800 CST
|
||||
carbon.Parse("2020-08-05 13:14:15").ToString() // 2020-08-05 13:14:15 +0800 CST
|
||||
carbon.Parse("2020-08-05 13:14:15.999").ToString() // 2020-08-05 13:14:15.999 +0800 CST
|
||||
carbon.Parse("2020-08-05 13:14:15.999999").ToString() // 2020-08-05 13:14:15.999999 +0800 CST
|
||||
carbon.Parse("2020-08-05 13:14:15.999999999").ToString() // 2020-08-05 13:14:15.999999999 +0800 CST
|
||||
|
||||
carbon.Parse("2020-08-05T13:14:15+08:00").ToString() // 2020-08-05 13:14:15 +0800 CST
|
||||
carbon.Parse("2020-08-05T13:14:15.999+08:00").ToString() // 2020-08-05 13:14:15.999 +0800 CST
|
||||
carbon.Parse("2020-08-05T13:14:15.999999+08:00").ToString() // 2020-08-05 13:14:15.999999 +0800 CST
|
||||
carbon.Parse("2020-08-05T13:14:15.999999999+08:00").ToString() // 2020-08-05 13:14:15.999999999 +0800 CST
|
||||
|
||||
carbon.Parse("20200805").ToString() // 2020-08-05 00:00:00 +0800 CST
|
||||
carbon.Parse("20200805131415").ToString() // 2020-08-05 13:14:15 +0800 CST
|
||||
carbon.Parse("20200805131415.999").ToString() // 2020-08-05 13:14:15.999 +0800 CST
|
||||
carbon.Parse("20200805131415.999999").ToString() // 2020-08-05 13:14:15.999999 +0800 CST
|
||||
@ -635,17 +637,8 @@ carbon.Parse("2020-07-05 13:14:15").SetLocale("en").DiffForHumans() // 1 month b
|
||||
carbon.Parse("2020-07-05 13:14:15").SetLocale("zh-CN").DiffForHumans() // 1 月前
|
||||
|
||||
// Set year, month, day, hour, minute and second.
|
||||
carbon.Parse("2020-01-01").SetDateTime(2019, 2, 2, 13, 14, 15).ToString() // 2019-02-02 13:14:15 +0800 CST
|
||||
carbon.Parse("2020-01-01").SetDateTime(2019, 2, 31, 13, 14, 15).ToString() // 2019-03-03 13:14:15 +0800 CST
|
||||
// Set year, month, day, hour, minute and second with millisecond.
|
||||
carbon.Parse("2020-01-01").SetDateTimeMilli(2019, 2, 2, 13, 14, 15, 999).ToString() // 2019-02-02 13:14:15.999 +0800 CST
|
||||
carbon.Parse("2020-01-01").SetDateTimeMilli(2019, 2, 31, 13, 14, 15, 999).ToString() // 2019-03-03 13:14:15.999 +0800 CST
|
||||
// Set year, month, day, hour, minute and second with microsecond.
|
||||
carbon.Parse("2020-01-01").SetDateTimeMicro(2019, 2, 2, 13, 14, 15, 999999).ToString() // 2019-02-02 13:14:15.999999 +0800 CST
|
||||
carbon.Parse("2020-01-01").SetDateTimeMicro(2019, 2, 31, 13, 14, 15, 999999).ToString() // 2019-03-03 13:14:15.999999 +0800 CST
|
||||
// Set year, month, day, hour, minute and second with nanosecond.
|
||||
carbon.Parse("2020-01-01").SetDateTimeNano(2019, 2, 2, 13, 14, 15, 999999999).ToString() // 2019-02-02 13:14:15.999999999 +0800 CST
|
||||
carbon.Parse("2020-01-01").SetDateTimeNano(2019, 2, 31, 13, 14, 15, 999999999).ToString() // 2019-03-03 13:14:15.999999999 +0800 CST
|
||||
carbon.Parse("2020-01-01").SetDateTime(2019, 2, 2, 13, 14, 15).ToDateTimeString() // 2019-02-02 13:14:15
|
||||
carbon.Parse("2020-01-01").SetDateTime(2019, 2, 31, 13, 14, 15).ToDateTimeString() // 2019-03-03 13:14:15
|
||||
|
||||
// Set year, month and day.
|
||||
carbon.Parse("2020-01-01").SetDate(2019, 2, 2).ToDateTimeString() // 2019-02-02 00:00:00
|
||||
|
Loading…
Reference in New Issue
Block a user