|
8 | 8 | {
|
9 | 9 | "name": "add",
|
10 | 10 | "description": "Add the given number of years, months and days to the DateTime",
|
11 |
| - "example": "datetime.format(datetime.add(\"2020-03-19T15:02:03Z\", 1,1, 3), \"RFC3339\") => 2021-04-22T15:02:03Z", |
| 11 | + "example": "datetime.addHours(datetime.current(), 3) => 2021-05-30T16:38:55.34586567Z", |
12 | 12 | "args": [
|
13 | 13 | {
|
14 | 14 | "name": "datetime",
|
|
40 | 40 | {
|
41 | 41 | "name": "addHours",
|
42 | 42 | "description": "Add the given number of hours to the DateTime",
|
43 |
| - "example": "datetime.format(datetime.addHours(\"2020-03-19T15:02:03\", 3), \"RFC3339\") => 2020-03-19T18:02:03Z", |
| 43 | + "example": "datetime.addHours(datetime.current(), 3) => 2020-04-27T19:38:55.345832054Z", |
44 | 44 | "args": [
|
45 | 45 | {
|
46 | 46 | "name": "datetime",
|
|
62 | 62 | {
|
63 | 63 | "name": "addMins",
|
64 | 64 | "description": "Add the given number of mins to the DateTime",
|
65 |
| - "example": "datetime.format(datetime.addMins(\"2020-03-19T15:02:03\", 30), \"RFC3339\") => 2020-03-19T19:32:03Z", |
| 65 | + "example": "datetime.addMins(datetime.current(), 30) => 2020-04-27T17:08:55.345841684Z", |
66 | 66 | "args": [
|
67 | 67 | {
|
68 | 68 | "name": "datetime",
|
|
84 | 84 | {
|
85 | 85 | "name": "addSeconds",
|
86 | 86 | "description": "Add the given number of seconds to the DateTime",
|
87 |
| - "example": "datetime.format(datetime.addSeconds(\"2020-03-19T15:02:03\", 30), \"RFC3339\") => 2020-03-19T18:02:33Z", |
| 87 | + "example": "datetime.addSeconds(datetime.current(), 30) => 2020-04-27T16:39:25.345860393Z", |
88 | 88 | "args": [
|
89 | 89 | {
|
90 | 90 | "name": "datetime",
|
|
106 | 106 | {
|
107 | 107 | "name": "create",
|
108 | 108 | "description": "Create date by given year, months, days, hours, mins, seconds, nanoseconds and timezone, the timezone follow the IANA Time Zone",
|
109 |
| - "example": "datetime.format(datetime.create(2020,1,3,2,22,0, \"America/Los_Angeles\"), \"RFC3339\") => 2020-01-03T02:22:00-08:00", |
| 109 | + "example": "datetime.create(2020,1,3,2,22,0,0, \"America/Los_Angeles\") => 2020-01-03T02:22:00-08:00", |
110 | 110 | "args": [
|
111 | 111 | {
|
112 | 112 | "name": "years",
|
|
192 | 192 | {
|
193 | 193 | "name": "diff",
|
194 | 194 | "description": "Return the difference between two given DateTime, the difference controlled by argument type, the type in (days,hours,mins and seconds)",
|
195 |
| - "example": "datetime.diff(\"2020-03-19T15:02:03\",\"2020-03-18:02:03\", \"hours\") => 3", |
| 195 | + "example": "datetime.diff(datetime.current(), datetime.addHours(datetime.current(), 2), \"hours\") => 2", |
196 | 196 | "args": [
|
197 | 197 | {
|
198 | 198 | "name": "start",
|
|
217 | 217 | {
|
218 | 218 | "name": "format",
|
219 | 219 | "description": "Format the date according to the specified format. The format uses MM(month), DD(day), YYYY(year), hh(hour), mm(minute) and ss(second), they are case insensitive except MM. it also can format with predefine layout ANSIC, UnixDate, RubyDate, RFC822, RFC822Z, RFC850, RFC1123, RFC1123Z, RFC3339 and RFC3339Nano",
|
220 |
| - "example": "datetime.format(\"02/08/2017\", \"dd-MM-yyyy\")=> 08-02-2017", |
| 220 | + "example": "datetime.format(datetime.current(), \"RFC3339\")=> 2020-04-27T16:38:45Z", |
221 | 221 | "args": [
|
222 | 222 | {
|
223 | 223 | "name": "datetime",
|
|
298 | 298 | {
|
299 | 299 | "name": "parse",
|
300 | 300 | "description": "Parse the given datetime to the DateTime with time zone, default base on UTC and timezone follow the IANA Time Zone ",
|
301 |
| - "example": "datetime.format(datetime.addSeconds(\"2020-03-19T15:02:03+06:00\", \"America/Los_Angeles\"), \"RFC3339\") => 2020-03-19T02:02:03-07:00", |
| 301 | + "example": "datetime.parse(\"2020-03-19T15:02:03+06:00\", \"America/Los_Angeles\") => 2020-03-19T02:02:03-07:00", |
302 | 302 | "args": [
|
303 | 303 | {
|
304 | 304 | "name": "str",
|
|
320 | 320 | {
|
321 | 321 | "name": "sub",
|
322 | 322 | "description": "Subtract the given number of years, months and days from the DateTime",
|
323 |
| - "example": "datetime.format(datetime.sub(\"2020-03-19T15:02:03\", 1,1,1), \"RFC3339\") => 2019-02-18T15:02:03Z", |
| 323 | + "example": "datetime.sub(datetime.current(), 1,1,1) => 2019-03-26T16:38:55.345876511Z", |
324 | 324 | "args": [
|
325 | 325 | {
|
326 | 326 | "name": "datetime",
|
|
352 | 352 | {
|
353 | 353 | "name": "subHours",
|
354 | 354 | "description": "Subtract the given number of hours from the DateTime",
|
355 |
| - "example": "datetime.format(datetime.subHours(\"2020-03-19T15:02:03\",1), \"RFC3339\") => 2020-03-19T14:02:03Z", |
| 355 | + "example": "datetime.subHours(datetime.current(),1) => 2020-04-27T15:38:55.345861378Z", |
356 | 356 | "args": [
|
357 | 357 | {
|
358 | 358 | "name": "datetime",
|
|
373 | 373 | {
|
374 | 374 | "name": "subMins",
|
375 | 375 | "description": "Subtract the given number of minutes from the DateTime",
|
376 |
| - "example": "datetime.format(datetime.subMins(\"2020-03-19T15:02:03\",10), \"RFC3339\") => 2020-03-19T14:52:03Z", |
| 376 | + "example": "datetime.subMins(datetime.current(),10) => 2020-04-27T16:28:55.345864058Z", |
377 | 377 | "args": [
|
378 | 378 | {
|
379 | 379 | "name": "datetime",
|
|
394 | 394 | {
|
395 | 395 | "name": "subSeconds",
|
396 | 396 | "description": "Subtract the given number of seconds from the DateTime",
|
397 |
| - "example": "datetime.format(datetime.subSeconds(\"2020-03-19T15:02:03\",10), \"RFC3339\") => 2020-03-19T15:01:53Z", |
| 397 | + "example": "datetime.subSeconds(datetime.current(),10) => 2020-04-27T16:38:45.346028182Z", |
398 | 398 | "args": [
|
399 | 399 | {
|
400 | 400 | "name": "datetime",
|
|
0 commit comments