Skip to content

Commit 6ffe8b8

Browse files
committed
update documentation
1 parent 09e9872 commit 6ffe8b8

5 files changed

Lines changed: 617 additions & 4 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Install-Module PSDates
1313
| Cmdlet | Synopsis |
1414
| ------ | -------- |
1515
| [Convert-TimeZone](docs/Convert-TimeZone.md) | Convert a datetime value from one time zone to another |
16+
| [Convert-ToDateTime](docs/Convert-ToDateTime.md) | Converts various input objects to a DateTime object. |
1617
| [ConvertFrom-UnixTime](docs/ConvertFrom-UnixTime.md) | Converts a Unix Time value to a datetime value |
1718
| [ConvertFrom-WmiDateTime](docs/ConvertFrom-WmiDateTime.md) | Converts a Wmi Time value to a datetime value |
1819
| [ConvertTo-UnixTime](docs/ConvertTo-UnixTime.md) | Converts a datetime value to Unix Time |
@@ -25,6 +26,8 @@ Install-Module PSDates
2526
| [Get-Easter](docs/Get-Easter.md) | This function offers a generic Easter computing method for any given year, using Western, Orthodox or Julian algorithms. |
2627
| [Get-PatchTuesday](docs/Get-PatchTuesday.md) | Returns the second Tuesday of the month |
2728
| [Get-SunTime](docs/Get-SunTime.md) | Find sunrise and sunset times for any location on planet Earth. |
29+
| [Group-TimeSpan](docs/Group-TimeSpan.md) | Groups objects by a specified time span. |
30+
| [Measure-TimeSpan](docs/Measure-TimeSpan.md) | Measures statistical properties (such as sum, average, and maximum) of a specified property within grouped time spans. |
2831
| [New-Duration](docs/New-Duration.md) | Calculates the time span between two dates and returns the duration in the ISO 8601 format |
2932
| [Test-CrontabSchedule](docs/Test-CrontabSchedule.md) | Tests that a crontab string is valid |
3033

docs/Convert-ToDateTime.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
---
2+
external help file: PSDates-help.xml
3+
Module Name: PSDates
4+
online version:
5+
schema: 2.0.0
6+
---
7+
8+
# Convert-ToDateTime
9+
10+
## SYNOPSIS
11+
12+
Converts various input objects to a DateTime object.
13+
14+
## SYNTAX
15+
16+
### __AllParameterSets
17+
18+
```
19+
Convert-ToDateTime [-InputObject] <Object> [-ProgressAction <ActionPreference>] [<CommonParameters>]
20+
```
21+
22+
## DESCRIPTION
23+
24+
The `Convert-ToDateTime` function attempts to convert different types of input objects into a DateTime object.
25+
It supports input from various data types such as strings and objects that can be cast or converted to a DateTime.
26+
27+
28+
## EXAMPLES
29+
30+
### Example 1: EXAMPLE 1
31+
32+
```
33+
'2024-08-29' | Convert-ToDateTime
34+
```
35+
36+
Converts the string '2024-08-29' into a DateTime object representing the 29th of August, 2024.
37+
38+
39+
40+
41+
42+
43+
## PARAMETERS
44+
45+
### -InputObject
46+
47+
Specifies the input object to be converted to a DateTime.
48+
This parameter accepts pipeline input and is mandatory.
49+
50+
The input can be of any type:
51+
- If the input is already a DateTime, it will be returned as-is.
52+
- If the input is a string, it attempts to parse it into a DateTime.
53+
- Other input types will be processed accordingly, if possible.
54+
55+
```yaml
56+
Type: Object
57+
Parameter Sets: (All)
58+
Aliases:
59+
Accepted values:
60+
61+
Required: True (All) False (None)
62+
Position: 0
63+
Default value:
64+
Accept pipeline input: True
65+
Accept wildcard characters: False
66+
DontShow: False
67+
```
68+
69+
### -ProgressAction
70+
71+
{{ Fill ProgressAction Description }}
72+
73+
```yaml
74+
Type: ActionPreference
75+
Parameter Sets: (All)
76+
Aliases: proga
77+
Accepted values:
78+
79+
Required: True (None) False (All)
80+
Position: Named
81+
Default value:
82+
Accept pipeline input: False
83+
Accept wildcard characters: False
84+
DontShow: False
85+
```
86+
87+
88+
### CommonParameters
89+
90+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
91+
92+
## INPUTS
93+
94+
### System.Object
95+
The function accepts objects from the pipeline, which are attempted to be converted to DateTime.
96+
97+
98+
## OUTPUTS
99+
100+
### System.DateTime
101+
The function outputs a DateTime object if the conversion is successful.
102+
103+
104+
## NOTES
105+
106+
107+
108+
## RELATED LINKS
109+
110+
Fill Related Links Here
111+

docs/Get-SunTime.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Find sunrise and sunset times for any location on planet Earth.
1616
### __AllParameterSets
1717

1818
```
19-
Get-SunTime [[-Date <DateTime>]] [[-Latitude <Double>]] [[-Longitude <Double>]] [[-Elevation <Double>]] [[-TimeZone <TimeZoneInfo>]] [-ProgressAction <ActionPreference>] [<CommonParameters>]
19+
Get-SunTime [[-Date <DateTime>]] [-Latitude] <Double> [-Longitude] <Double> [[-Elevation <Double>]] [[-TimeZone <String>]] [-ProgressAction <ActionPreference>] [<CommonParameters>]
2020
```
2121

2222
## DESCRIPTION
@@ -102,7 +102,7 @@ Parameter Sets: (All)
102102
Aliases:
103103
Accepted values:
104104

105-
Required: True (None) False (All)
105+
Required: True (All) False (None)
106106
Position: 1
107107
Default value: 0
108108
Accept pipeline input: False
@@ -120,7 +120,7 @@ Parameter Sets: (All)
120120
Aliases:
121121
Accepted values:
122122

123-
Required: True (None) False (All)
123+
Required: True (All) False (None)
124124
Position: 2
125125
Default value: 0
126126
Accept pipeline input: False
@@ -151,7 +151,7 @@ DontShow: False
151151
The time zone for the final results
152152
153153
```yaml
154-
Type: TimeZoneInfo
154+
Type: String
155155
Parameter Sets: (All)
156156
Aliases:
157157
Accepted values:

0 commit comments

Comments
 (0)