Skip to content

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 20 Jan 00:27
94e3625

🚀 [Feature]: Add Get-CurrentDateTime function (#14)

The module now includes a new Get-CurrentDateTime function that provides flexible date and time formatting options. You can retrieve the current date/time in multiple preset formats or specify your own custom format string, making it easier to generate timestamps for logging, file naming, or display purposes.

New function: Get-CurrentDateTime

A new public function Get-CurrentDateTime is available with the following format options:

Format Description Example Output
Default Standard timestamp format 2026-01-20 14:30:45
Short Locale-specific short date 1/20/2026
Long Locale-specific long date Monday, January 20, 2026
ISO8601 ISO 8601 format with timezone 2026-01-20T14:30:45.1234567+01:00
Custom User-defined format string Depends on -CustomFormat parameter

Usage examples

# Get current date/time in default format
Get-CurrentDateTime
# Returns: 2026-01-20 14:30:45

# Get ISO 8601 formatted timestamp
Get-CurrentDateTime -Format 'ISO8601'
# Returns: 2026-01-20T14:30:45.1234567+01:00

# Use a custom format
Get-CurrentDateTime -Format 'Custom' -CustomFormat 'dddd, MMMM dd, yyyy'
# Returns: Monday, January 20, 2026

Tests included

Comprehensive Pester tests are included covering all format options to ensure reliable functionality.