TianoCore EDK2 master
Loading...
Searching...
No Matches
TimeDate.c File Reference

Go to the source code of this file.

Data Structures

struct  TIME_ZONE_ITEM
 

Functions

BOOLEAN InternalIsTimeLikeString (IN CONST CHAR16 *String, IN CONST CHAR16 Char, IN CONST UINTN Min, IN CONST UINTN Max, IN CONST BOOLEAN MinusOk)
 
SHELL_STATUS CheckAndSetDate (IN CONST CHAR16 *DateString)
 
SHELL_STATUS EFIAPI ShellCommandRunDate (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
SHELL_STATUS CheckAndSetTime (IN CONST CHAR16 *TimeString, IN CONST INT16 Tz, IN CONST UINT8 Daylight)
 
SHELL_STATUS EFIAPI ShellCommandRunTime (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
SHELL_STATUS CheckAndSetTimeZone (IN CONST CHAR16 *TimeZoneString)
 
SHELL_STATUS EFIAPI ShellCommandRunTimeZone (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

STATIC CONST SHELL_PARAM_ITEM TimeParamList2 []
 
STATIC CONST SHELL_PARAM_ITEM TimeParamList3 []
 
STATIC CONST SHELL_PARAM_ITEM TimeZoneParamList2 []
 
STATIC CONST SHELL_PARAM_ITEM TimeZoneParamList3 []
 
STATIC CONST TIME_ZONE_ITEM TimeZoneList []
 

Detailed Description

Main file for time, timezone, and date shell level 2 and shell level 3 functions.

(C) Copyright 2012-2015 Hewlett-Packard Development Company, L.P.
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file TimeDate.c.

Function Documentation

◆ CheckAndSetDate()

SHELL_STATUS CheckAndSetDate ( IN CONST CHAR16 *  DateString)

Verify that the DateString is valid and if so set that as the current date.

Parameters
[in]DateStringThe pointer to a string representation of the date.
Return values
SHELL_INVALID_PARAMETERDateString was NULL.
SHELL_INVALID_PARAMETERDateString was mis-formatted.
SHELL_SUCCESSThe operation was successful.

Definition at line 89 of file TimeDate.c.

◆ CheckAndSetTime()

SHELL_STATUS CheckAndSetTime ( IN CONST CHAR16 *  TimeString,
IN CONST INT16  Tz,
IN CONST UINT8  Daylight 
)

Verify that the TimeString is valid and if so set that as the current time.

Parameters
[in]TimeStringThe pointer to a string representation of the time.
[in]TzThe value to set for TimeZone.
[in]DaylightThe value to set for Daylight.
Return values
SHELL_INVALID_PARAMETERTimeString was NULL.
SHELL_INVALID_PARAMETERTimeString was mis-formatted.
SHELL_SUCCESSThe operation was successful.

Definition at line 310 of file TimeDate.c.

◆ CheckAndSetTimeZone()

SHELL_STATUS CheckAndSetTimeZone ( IN CONST CHAR16 *  TimeZoneString)

Verify that the TimeZoneString is valid and if so set that as the current timezone.

Parameters
[in]TimeZoneStringThe pointer to a string representation of the timezone.
Return values
SHELL_INVALID_PARAMETERTimeZoneString was NULL.
SHELL_INVALID_PARAMETERTimeZoneString was mis-formatted.
SHELL_SUCCESSThe operation was successful.

Definition at line 720 of file TimeDate.c.

◆ InternalIsTimeLikeString()

BOOLEAN InternalIsTimeLikeString ( IN CONST CHAR16 *  String,
IN CONST CHAR16  Char,
IN CONST UINTN  Min,
IN CONST UINTN  Max,
IN CONST BOOLEAN  MinusOk 
)

Determine if String is a valid representation for a time or date.

Parameters
[in]StringThe pointer to the string to test.
[in]CharThe delimeter character.
[in]MinThe minimum value allowed.
[in]MaxThe maximum value allowed.
[in]MinusOkWhether negative numbers are permitted.
Return values
TRUEString is a valid representation.
FALSEString is invalid.

Definition at line 25 of file TimeDate.c.

◆ ShellCommandRunDate()

SHELL_STATUS EFIAPI ShellCommandRunDate ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Function for 'date' command.

Parameters
[in]ImageHandleHandle to the Image (NULL if Internal).
[in]SystemTablePointer to the System Table (NULL if Internal).

Definition at line 177 of file TimeDate.c.

◆ ShellCommandRunTime()

SHELL_STATUS EFIAPI ShellCommandRunTime ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Function for 'time' command.

Parameters
[in]ImageHandleHandle to the Image (NULL if Internal).
[in]SystemTablePointer to the System Table (NULL if Internal).

Definition at line 409 of file TimeDate.c.

◆ ShellCommandRunTimeZone()

SHELL_STATUS EFIAPI ShellCommandRunTimeZone ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Function for 'timezone' command.

Parameters
[in]ImageHandleHandle to the Image (NULL if Internal).
[in]SystemTablePointer to the System Table (NULL if Internal).

Definition at line 821 of file TimeDate.c.

Variable Documentation

◆ TimeParamList2

STATIC CONST SHELL_PARAM_ITEM TimeParamList2[]
Initial value:
= {
{ L"-d", TypeValue },
{ NULL, TypeMax }
}
#define NULL
Definition: Base.h:319
@ TypeValue
A flag that has some data following it with a space (IE "-a 1").
Definition: ShellLib.h:700

Definition at line 286 of file TimeDate.c.

◆ TimeParamList3

STATIC CONST SHELL_PARAM_ITEM TimeParamList3[]
Initial value:
= {
{ L"-d", TypeValue },
{ L"-tz", TypeValue },
{ NULL, TypeMax }
}

Definition at line 291 of file TimeDate.c.

◆ TimeZoneList

STATIC CONST TIME_ZONE_ITEM TimeZoneList[]

Definition at line 670 of file TimeDate.c.

◆ TimeZoneParamList2

STATIC CONST SHELL_PARAM_ITEM TimeZoneParamList2[]
Initial value:
= {
{ L"-l", TypeFlag },
{ L"-f", TypeFlag },
{ NULL, TypeMax }
}
@ TypeFlag
A flag that is present or not present only (IE "-a").
Definition: ShellLib.h:699

Definition at line 658 of file TimeDate.c.

◆ TimeZoneParamList3

STATIC CONST SHELL_PARAM_ITEM TimeZoneParamList3[]
Initial value:
= {
{ L"-l", TypeFlag },
{ L"-f", TypeFlag },
{ L"-s", TypeTimeValue },
{ NULL, TypeMax }
}
@ TypeTimeValue
A flag that has a time value following it (IE "-a -5:00").
Definition: ShellLib.h:705

Definition at line 663 of file TimeDate.c.