Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 484d121

Browse files
authored
[[ Documentation ]] Fixes to convert.lcdoc
* Clarified and updated examples. * Added html5 as a platform. * Removed The result element; convert does not populate the result. * Moved description from The result into the body of the Description element. * Corrections to references and embedded links.
1 parent 2401f17 commit 484d121

File tree

1 file changed

+25
-23
lines changed

1 file changed

+25
-23
lines changed

docs/dictionary/command/convert.lcdoc

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,44 +9,48 @@ Changes a date, a time, or a date and time to a specified format.
99

1010
Introduced: 1.0
1111

12-
OS: mac, windows, linux, ios, android
12+
OS: mac, windows, linux, ios, android, html5
1313

1414
Platforms: desktop, server, mobile
1515

1616
Example:
17-
convert "11/22/90" to long english date
17+
convert "11/22/2016" to long english date
18+
put it
1819

1920
Example:
2021
convert the internet date from internet date to system date
2122

2223
Example:
24+
local lastChangedTime
25+
put the date && the long time into lastChangedTime
2326
convert lastChangedTime to abbreviated time and long date
2427

2528
Example:
2629
convert the date && the time to seconds
30+
put it
2731

2832
Parameters:
2933
dateAndTime (string):
3034
A string or container with a date, a time, or a date and time separated
3135
by a space, tab, or return character.
3236

3337
format:
34-
One of the following (examples are February 17, 2000 at 10:13:21 PM, in
38+
One of the following (examples are February 17, 2017 at 10:13:21 PM, in
3539
the Eastern time zone, using US date and time formats): If you specify
3640
both a date and time format, they can be in either order and must be
3741
separated by a space. The resulting date and time are in the order you
38-
provided, separated by a space. If you specify seconds or dateItems, you
42+
provided, separated by a space. If you specify seconds or <dateItems>, you
3943
can request only one format.
4044

41-
- "short date": 2/17/00
42-
- "abbreviated date": Thu, Feb 17, 2000
43-
- "long date": Thursday, February 17, 2000
45+
- "short date": 2/17/17
46+
- "abbreviated date": Thu, Feb 17, 2017
47+
- "long date": Thursday, February 17, 2017
4448
- "short time": 10:13 PM
4549
- "abbreviated time": 10:13 PM
4650
- "long time": 10:13:21 PM
47-
- "internet date": Thu, 17 Feb 2000 22:13:21 -0500
51+
- "internet date": Thu, 17 Feb 2017 22:13:21 -0500
4852
- "seconds": the number of seconds since the start of the epoch
49-
- "dateItems": 2000,2,17,22,13,21,5
53+
- "dateItems": 2017,2,17,22,13,21,5
5054

5155

5256
It:
@@ -55,18 +59,11 @@ placed in the <container>, replacing the previous contents. If the
5559
<dateAndTime> is a <string>, the converted date and time is placed in
5660
the <it> <variable>.
5761

58-
The result:
59-
For example, suppose you start with 9:30 AM , convert that time to
60-
<dateItems> format, then add 45 minutes to item 5 (the minute) of the
61-
resulting value. This gives you 75 as the minute. When you convert the
62-
value to any other time format, the <convert> <command> automatically
63-
converts "75 minutes" to "1 hour and 15 minutes" :.
64-
6562
Description:
6663
Use the <convert> <command> to change a date or time to a <format>
6764
that's more convenient for calculation or display.
6865

69-
The dateItems format is a comma-separated list of numbers:
66+
The <dateItems> format is a comma-separated list of numbers:
7067

7168
* the year
7269
* the month number
@@ -78,12 +75,18 @@ The dateItems format is a comma-separated list of numbers:
7875
and so forth
7976

8077

81-
The <convert> <command> can handle dates in dateItems format where one
78+
The <convert> <command> can handle dates in <dateItems> format where one
8279
or more of the items is out of the normal range. This means you can add
83-
arbitrary numbers to an item in the dateItems and let the <convert>
80+
arbitrary numbers to an item in the <dateItems> and let the <convert>
8481
<command> handle the calculations that span minute, hour, day, month,
8582
and year boundaries.
8683

84+
For example, suppose you start with 9:30 AM, convert that time to
85+
<dateItems> format, then add 45 minutes to item 5 (the minute) of the
86+
resulting value. This gives you 75 as the minute. When you convert the
87+
value to any other time format, the <convert> <command> automatically
88+
converts "75 minutes" to "1 hour and 15 minutes" :
89+
8790
convert "9:30 AM" to dateItems
8891
add 45 to item 5 of it
8992
convert it to time -- yields "10:15 AM"
@@ -95,7 +98,7 @@ is true, or if you use the <system> keyword, the user's current system
9598
preferences are used to format the date or time. Otherwise, the standard
9699
US date and time formats are used.
97100

98-
The internet date, seconds, and dateItems formats are invariant and do
101+
The internet date, seconds, and <dateItems> formats are invariant and do
99102
not change according to the user's preferences.
100103

101104
>*Note:* The <convert> command assumes all dates / times are in local
@@ -108,9 +111,9 @@ not change according to the user's preferences.
108111
> limited by the operating system's date routines. In particular,
109112
> Windows systems are limited to dates after 1/1/1970.
110113

111-
References: sort container (command), convert (command), time (function),
114+
References: sort container (command), time (function),
112115
dateFormat (function), milliseconds (function), date (function),
113-
format (function), keyword (glossary), variable (glossary),
116+
format (glossary), keyword (glossary), variable (glossary),
114117
command (glossary), container (glossary), dateItems (keyword),
115118
system (keyword), long (keyword), short (keyword), string (keyword),
116119
seconds (keyword), abbreviated (keyword), internet (keyword),
@@ -119,4 +122,3 @@ useSystemDate (property), centuryCutoff (property),
119122
twelveHourTime (property)
120123

121124
Tags: math
122-

0 commit comments

Comments
 (0)