2 Main file for time, timezone, and date shell level 2 and shell level 3 functions.
4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #include "UefiShellLevel2CommandsLib.h"
31 InternalIsTimeLikeString (
32 IN CONST CHAR16
*String
,
36 IN CONST BOOLEAN MinusOk
44 // A single minus is ok.
46 if (*String
== L
'-') {
52 // the first char must be numeric.
54 if (!ShellIsDecimalDigitCharacter(*String
)) {
58 // loop through the characters and use the lib function
60 for ( ; String
!= NULL
&& *String
!= CHAR_NULL
; String
++){
61 if (*String
== Char
) {
68 if (!ShellIsDecimalDigitCharacter(*String
)) {
81 IN CONST CHAR16
*DateString
88 if (!InternalIsTimeLikeString(DateString
, L
'/', 2, 2, FALSE
)) {
89 return (SHELL_INVALID_PARAMETER
);
92 Status
= gRT
->GetTime(&TheTime
, NULL
);
93 ASSERT_EFI_ERROR(Status
);
99 TheTime
.Year
= 0xFFFF;
101 TheTime
.Month
= (UINT8
)StrDecimalToUintn (Walker
);
102 Walker
= StrStr(Walker
, L
"/");
103 if (Walker
!= NULL
&& *Walker
== L
'/') {
106 if (Walker
!= NULL
&& Walker
[0] != CHAR_NULL
) {
107 TheTime
.Day
= (UINT8
)StrDecimalToUintn (Walker
);
108 Walker
= StrStr(Walker
, L
"/");
109 if (Walker
!= NULL
&& *Walker
== L
'/') {
112 if (Walker
!= NULL
&& Walker
[0] != CHAR_NULL
) {
113 TheTime
.Year
= (UINT16
)StrDecimalToUintn (Walker
);
117 if (TheTime
.Year
< 100) {
118 if (TheTime
.Year
>= 98) {
119 TheTime
.Year
= (UINT16
)(1900 + TheTime
.Year
);
121 TheTime
.Year
= (UINT16
)(2000 + TheTime
.Year
);
125 Status
= gRT
->SetTime(&TheTime
);
127 if (!EFI_ERROR(Status
)){
128 return (SHELL_SUCCESS
);
130 return (SHELL_INVALID_PARAMETER
);
134 Function for 'date' command.
136 @param[in] ImageHandle Handle to the Image (NULL if Internal).
137 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
141 ShellCommandRunDate (
142 IN EFI_HANDLE ImageHandle
,
143 IN EFI_SYSTEM_TABLE
*SystemTable
149 CHAR16
*ProblemParam
;
150 SHELL_STATUS ShellStatus
;
152 ShellStatus
= SHELL_SUCCESS
;
156 // initialize the shell lib (we must be in non-auto-init...)
158 Status
= ShellInitialize();
159 ASSERT_EFI_ERROR(Status
);
162 // parse the command line
164 Status
= ShellCommandLineParse (SfoParamList
, &Package
, &ProblemParam
, TRUE
);
165 if (EFI_ERROR(Status
)) {
166 if (Status
== EFI_VOLUME_CORRUPTED
&& ProblemParam
!= NULL
) {
167 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_PROBLEM
), gShellLevel2HiiHandle
, ProblemParam
);
168 FreePool(ProblemParam
);
169 ShellStatus
= SHELL_INVALID_PARAMETER
;
177 if (ShellCommandLineGetFlag(Package
, L
"-?")) {
179 } else if (ShellCommandLineGetRawValue(Package
, 2) != NULL
) {
180 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_TOO_MANY
), gShellLevel2HiiHandle
);
181 ShellStatus
= SHELL_INVALID_PARAMETER
;
184 // If there are 0 value parameters, then print the current date
185 // else If there are any value paramerers, then print error
187 if (ShellCommandLineGetRawValue(Package
, 1) == NULL
) {
189 // get the current date
191 Status
= gRT
->GetTime(&TheTime
, NULL
);
192 ASSERT_EFI_ERROR(Status
);
195 // ShellPrintEx the date in SFO or regular format
197 if (ShellCommandLineGetFlag(Package
, L
"-sfo")) {
198 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_DATE_SFO_FORMAT
), gShellLevel2HiiHandle
, TheTime
.Month
, TheTime
.Day
, TheTime
.Year
);
200 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_DATE_FORMAT
), gShellLevel2HiiHandle
, TheTime
.Month
, TheTime
.Day
, TheTime
.Year
);
203 if (PcdGet8(PcdShellSupportLevel
) == 2) {
204 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_TOO_MANY
), gShellLevel2HiiHandle
);
205 ShellStatus
= SHELL_INVALID_PARAMETER
;
208 // perform level 3 operation here.
210 ShellStatus
= CheckAndSetDate(ShellCommandLineGetRawValue(Package
, 1));
211 if (ShellStatus
!= SHELL_SUCCESS
) {
212 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_PROBLEM
), gShellLevel2HiiHandle
, ShellCommandLineGetRawValue(Package
, 1));
213 ShellStatus
= SHELL_INVALID_PARAMETER
;
220 // free the command line package
222 ShellCommandLineFreeVarList (Package
);
227 return (ShellStatus
);
231 // Note "-tz" is invalid for this (non-interactive) version of 'time'.
233 STATIC CONST SHELL_PARAM_ITEM TimeParamList2
[] = {
238 STATIC CONST SHELL_PARAM_ITEM TimeParamList3
[] = {
247 IN CONST CHAR16
*TimeString
,
249 IN CONST UINT8 Daylight
254 CONST CHAR16
*Walker
;
256 if (TimeString
!= NULL
&& !InternalIsTimeLikeString(TimeString
, L
':', 1, 2, FALSE
)) {
257 return (SHELL_INVALID_PARAMETER
);
260 Status
= gRT
->GetTime(&TheTime
, NULL
);
261 ASSERT_EFI_ERROR(Status
);
263 if (TimeString
!= NULL
) {
266 TheTime
.Minute
= 0xFF;
268 TheTime
.Hour
= (UINT8
)StrDecimalToUintn (Walker
);
269 Walker
= StrStr(Walker
, L
":");
270 if (Walker
!= NULL
&& *Walker
== L
':') {
273 if (Walker
!= NULL
&& Walker
[0] != CHAR_NULL
) {
274 TheTime
.Minute
= (UINT8
)StrDecimalToUintn (Walker
);
275 Walker
= StrStr(Walker
, L
":");
276 if (Walker
!= NULL
&& *Walker
== L
':') {
279 if (Walker
!= NULL
&& Walker
[0] != CHAR_NULL
) {
280 TheTime
.Second
= (UINT8
)StrDecimalToUintn (Walker
);
285 if ((Tz
>= -1440 && Tz
<= 1440)||(Tz
== 2047)) {
286 TheTime
.TimeZone
= Tz
;
288 if (Daylight
<= 3 && Daylight
!= 2) {
289 TheTime
.Daylight
= Daylight
;
291 Status
= gRT
->SetTime(&TheTime
);
293 if (!EFI_ERROR(Status
)){
294 return (SHELL_SUCCESS
);
297 return (SHELL_INVALID_PARAMETER
);
301 Function for 'time' command.
303 @param[in] ImageHandle Handle to the Image (NULL if Internal).
304 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
308 ShellCommandRunTime (
309 IN EFI_HANDLE ImageHandle
,
310 IN EFI_SYSTEM_TABLE
*SystemTable
317 CHAR16
*ProblemParam
;
318 SHELL_STATUS ShellStatus
;
321 CONST CHAR16
*TempLocation
;
324 ShellStatus
= SHELL_SUCCESS
;
328 // Initialize variables
333 // initialize the shell lib (we must be in non-auto-init...)
335 Status
= ShellInitialize();
336 ASSERT_EFI_ERROR(Status
);
339 // parse the command line
341 if (PcdGet8(PcdShellSupportLevel
) == 2) {
342 Status
= ShellCommandLineParseEx (TimeParamList2
, &Package
, &ProblemParam
, TRUE
, TRUE
);
344 ASSERT(PcdGet8(PcdShellSupportLevel
) == 3);
345 Status
= ShellCommandLineParseEx (TimeParamList3
, &Package
, &ProblemParam
, TRUE
, TRUE
);
347 if (EFI_ERROR(Status
)) {
348 if (Status
== EFI_VOLUME_CORRUPTED
&& ProblemParam
!= NULL
) {
349 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_PROBLEM
), gShellLevel2HiiHandle
, ProblemParam
);
350 FreePool(ProblemParam
);
351 ShellStatus
= SHELL_INVALID_PARAMETER
;
359 Status
= gRT
->GetTime(&TheTime
, NULL
);
360 ASSERT_EFI_ERROR(Status
);
361 if (ShellCommandLineGetFlag(Package
, L
"-?")) {
363 } else if (ShellCommandLineGetRawValue(Package
, 2) != NULL
) {
364 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_TOO_MANY
), gShellLevel2HiiHandle
);
365 ShellStatus
= SHELL_INVALID_PARAMETER
;
368 // If there are no parameters, then print the current time
370 if (ShellCommandLineGetRawValue(Package
, 1) == NULL
371 && !ShellCommandLineGetFlag(Package
, L
"-d")
372 && !ShellCommandLineGetFlag(Package
, L
"-tz")) {
374 // ShellPrintEx the current time
376 if (TheTime
.TimeZone
== 2047) {
379 TzMinutes
= AbsVal(TheTime
.TimeZone
) % 60;
386 STRING_TOKEN (STR_TIME_FORMAT
),
387 gShellLevel2HiiHandle
,
391 TheTime
.TimeZone
==2047?L
" ":(TheTime
.TimeZone
> 0?L
"-":L
"+"),
392 TheTime
.TimeZone
==2047?0:AbsVal(TheTime
.TimeZone
) / 60,
395 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_CRLF
), gShellLevel2HiiHandle
);
396 } else if (ShellCommandLineGetFlag(Package
, L
"-d") && ShellCommandLineGetValue(Package
, L
"-d") == NULL
) {
397 if (TheTime
.TimeZone
== 2047) {
400 TzMinutes
= AbsVal(TheTime
.TimeZone
) % 60;
407 STRING_TOKEN (STR_TIME_FORMAT
),
408 gShellLevel2HiiHandle
,
412 TheTime
.TimeZone
==2047?L
" ":(TheTime
.TimeZone
> 0?L
"-":L
"+"),
413 TheTime
.TimeZone
==2047?0:AbsVal(TheTime
.TimeZone
) / 60,
416 switch (TheTime
.Daylight
) {
418 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_TIME_DSTNA
), gShellLevel2HiiHandle
);
420 case EFI_TIME_ADJUST_DAYLIGHT
:
421 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_TIME_DSTST
), gShellLevel2HiiHandle
);
423 case EFI_TIME_IN_DAYLIGHT
:
424 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_TIME_DSTDT
), gShellLevel2HiiHandle
);
427 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_UEFI_FUNC_ERROR
), gShellLevel2HiiHandle
, L
"gRT->GetTime", L
"TheTime.Daylight", TheTime
.Daylight
);
430 if (PcdGet8(PcdShellSupportLevel
) == 2) {
431 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_TOO_MANY
), gShellLevel2HiiHandle
);
432 ShellStatus
= SHELL_INVALID_PARAMETER
;
435 // perform level 3 operation here.
437 if ((TempLocation
= ShellCommandLineGetValue(Package
, L
"-tz")) != NULL
) {
438 if (TempLocation
[0] == L
'-') {
439 Tz
= (INT16
)(0 - StrDecimalToUintn(++TempLocation
));
441 Tz
= (INT16
)StrDecimalToUintn(TempLocation
);
443 if (!(Tz
>= -1440 && Tz
<= 1440) && Tz
!= 2047) {
444 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_PROBLEM
), gShellLevel2HiiHandle
, L
"-d");
445 ShellStatus
= SHELL_INVALID_PARAMETER
;
449 // intentionally out of bounds value will prevent changing it...
453 TempLocation
= ShellCommandLineGetValue(Package
, L
"-d");
454 if (TempLocation
!= NULL
) {
455 Daylight
= (UINT8
)StrDecimalToUintn(TempLocation
);
456 if (Daylight
!= 0 && Daylight
!= 1 && Daylight
!= 3) {
457 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_PROBLEM
), gShellLevel2HiiHandle
, L
"-d");
458 ShellStatus
= SHELL_INVALID_PARAMETER
;
462 // invalid = will not use
466 if (ShellStatus
== SHELL_SUCCESS
) {
467 ShellStatus
= CheckAndSetTime(ShellCommandLineGetRawValue(Package
, 1), Tz
, Daylight
);
468 if (ShellStatus
!= SHELL_SUCCESS
) {
469 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_PROBLEM
), gShellLevel2HiiHandle
, ShellCommandLineGetRawValue(Package
, 1));
470 ShellStatus
= SHELL_INVALID_PARAMETER
;
479 // free the command line package
481 ShellCommandLineFreeVarList (Package
);
486 return (ShellStatus
);
491 EFI_STRING_ID StringId
;
494 STATIC CONST SHELL_PARAM_ITEM TimeZoneParamList2
[] = {
499 STATIC CONST SHELL_PARAM_ITEM TimeZoneParamList3
[] = {
506 STATIC CONST TIME_ZONE_ITEM TimeZoneList
[] = {
507 {720, STRING_TOKEN (STR_TIMEZONE_M12
)},
508 {660, STRING_TOKEN (STR_TIMEZONE_M11
)},
509 {600, STRING_TOKEN (STR_TIMEZONE_M10
)},
510 {540, STRING_TOKEN (STR_TIMEZONE_M9
)},
511 {480, STRING_TOKEN (STR_TIMEZONE_M8
)},
512 {420, STRING_TOKEN (STR_TIMEZONE_M7
)},
513 {360, STRING_TOKEN (STR_TIMEZONE_M6
)},
514 {300, STRING_TOKEN (STR_TIMEZONE_M5
)},
515 {270, STRING_TOKEN (STR_TIMEZONE_M430
)},
516 {240, STRING_TOKEN (STR_TIMEZONE_M4
)},
517 {210, STRING_TOKEN (STR_TIMEZONE_M330
)},
518 {180, STRING_TOKEN (STR_TIMEZONE_M3
)},
519 {120, STRING_TOKEN (STR_TIMEZONE_M2
)},
520 {60 , STRING_TOKEN (STR_TIMEZONE_M1
)},
521 {0 , STRING_TOKEN (STR_TIMEZONE_0
)},
522 {-60 , STRING_TOKEN (STR_TIMEZONE_P1
)},
523 {-120 , STRING_TOKEN (STR_TIMEZONE_P2
)},
524 {-180 , STRING_TOKEN (STR_TIMEZONE_P3
)},
525 {-210 , STRING_TOKEN (STR_TIMEZONE_P330
)},
526 {-240 , STRING_TOKEN (STR_TIMEZONE_P4
)},
527 {-270 , STRING_TOKEN (STR_TIMEZONE_P430
)},
528 {-300 , STRING_TOKEN (STR_TIMEZONE_P5
)},
529 {-330 , STRING_TOKEN (STR_TIMEZONE_P530
)},
530 {-345 , STRING_TOKEN (STR_TIMEZONE_P545
)},
531 {-360 , STRING_TOKEN (STR_TIMEZONE_P6
)},
532 {-390 , STRING_TOKEN (STR_TIMEZONE_P630
)},
533 {-420 , STRING_TOKEN (STR_TIMEZONE_P7
)},
534 {-480 , STRING_TOKEN (STR_TIMEZONE_P8
)},
535 {-540 , STRING_TOKEN (STR_TIMEZONE_P9
)},
536 {-570 , STRING_TOKEN (STR_TIMEZONE_P930
)},
537 {-600 , STRING_TOKEN (STR_TIMEZONE_P10
)},
538 {-660 , STRING_TOKEN (STR_TIMEZONE_P11
)},
539 {-720 , STRING_TOKEN (STR_TIMEZONE_P12
)},
540 {-780 , STRING_TOKEN (STR_TIMEZONE_P13
)},
541 {-840 , STRING_TOKEN (STR_TIMEZONE_P14
)}
546 CheckAndSetTimeZone (
547 IN CONST CHAR16
*TimeZoneString
552 CONST CHAR16
*Walker
;
555 if (TimeZoneString
== NULL
) {
556 return (SHELL_INVALID_PARAMETER
);
559 if (TimeZoneString
!= NULL
&& !InternalIsTimeLikeString(TimeZoneString
, L
':', 1, 1, TRUE
)) {
560 return (SHELL_INVALID_PARAMETER
);
563 Status
= gRT
->GetTime(&TheTime
, NULL
);
564 ASSERT_EFI_ERROR(Status
);
566 Walker
= TimeZoneString
;
567 if (*Walker
== L
'-') {
568 TheTime
.TimeZone
= (INT16
)((StrDecimalToUintn (++Walker
)) * 60);
570 TheTime
.TimeZone
= (INT16
)((StrDecimalToUintn (Walker
)) * -60);
572 Walker
= StrStr(Walker
, L
":");
573 if (Walker
!= NULL
&& *Walker
== L
':') {
576 if (Walker
!= NULL
&& Walker
[0] != CHAR_NULL
) {
577 if (TheTime
.TimeZone
< 0) {
578 TheTime
.TimeZone
= (INT16
)(TheTime
.TimeZone
- (UINT8
)StrDecimalToUintn (Walker
));
580 TheTime
.TimeZone
= (INT16
)(TheTime
.TimeZone
+ (UINT8
)StrDecimalToUintn (Walker
));
584 Status
= EFI_INVALID_PARAMETER
;
587 ; LoopVar
< sizeof(TimeZoneList
) / sizeof(TimeZoneList
[0])
590 if (TheTime
.TimeZone
== TimeZoneList
[LoopVar
].TimeZone
) {
591 Status
= gRT
->SetTime(&TheTime
);
596 if (!EFI_ERROR(Status
)){
597 return (SHELL_SUCCESS
);
599 return (SHELL_INVALID_PARAMETER
);
604 Function for 'timezone' command.
606 @param[in] ImageHandle Handle to the Image (NULL if Internal).
607 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
611 ShellCommandRunTimeZone (
612 IN EFI_HANDLE ImageHandle
,
613 IN EFI_SYSTEM_TABLE
*SystemTable
621 CHAR16
*ProblemParam
;
622 SHELL_STATUS ShellStatus
;
628 ShellStatus
= SHELL_SUCCESS
;
632 // initialize the shell lib (we must be in non-auto-init...)
634 Status
= ShellInitialize();
635 ASSERT_EFI_ERROR(Status
);
638 // parse the command line
640 if (PcdGet8(PcdShellSupportLevel
) == 2) {
641 Status
= ShellCommandLineParse (TimeZoneParamList2
, &Package
, &ProblemParam
, FALSE
);
643 ASSERT(PcdGet8(PcdShellSupportLevel
) == 3);
644 Status
= ShellCommandLineParseEx (TimeZoneParamList3
, &Package
, &ProblemParam
, FALSE
, TRUE
);
646 if (EFI_ERROR(Status
)) {
647 if (Status
== EFI_VOLUME_CORRUPTED
&& ProblemParam
!= NULL
) {
648 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_PROBLEM
), gShellLevel2HiiHandle
, ProblemParam
);
649 FreePool(ProblemParam
);
650 ShellStatus
= SHELL_INVALID_PARAMETER
;
658 if (ShellCommandLineGetCount(Package
) > 1) {
659 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_TOO_MANY
), gShellLevel2HiiHandle
);
660 ShellStatus
= SHELL_INVALID_PARAMETER
;
661 } else if (ShellCommandLineGetFlag(Package
, L
"-?")) {
663 } else if (ShellCommandLineGetFlag(Package
, L
"-s")) {
664 if ((ShellCommandLineGetFlag(Package
, L
"-l")) || (ShellCommandLineGetFlag(Package
, L
"-f"))) {
665 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_PROBLEM
), gShellLevel2HiiHandle
, L
"-l or -f");
666 ShellStatus
= SHELL_INVALID_PARAMETER
;
668 ASSERT(PcdGet8(PcdShellSupportLevel
) == 3);
669 if (ShellCommandLineGetValue(Package
, L
"-s") == NULL
) {
670 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_NO_VALUE
), gShellLevel2HiiHandle
, L
"-s");
671 ShellStatus
= SHELL_INVALID_PARAMETER
;
676 ShellStatus
= CheckAndSetTimeZone(ShellCommandLineGetValue(Package
, L
"-s"));
677 if (ShellStatus
!= SHELL_SUCCESS
) {
678 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_PROBLEM
), gShellLevel2HiiHandle
, ShellCommandLineGetValue(Package
, L
"-s"));
679 ShellStatus
= SHELL_INVALID_PARAMETER
;
683 } else if (ShellCommandLineGetFlag(Package
, L
"-l")) {
685 // Print a list of all time zones
688 ; LoopVar
< sizeof(TimeZoneList
) / sizeof(TimeZoneList
[0])
691 ShellPrintHiiEx (-1, -1, NULL
, TimeZoneList
[LoopVar
].StringId
, gShellLevel2HiiHandle
);
695 // Get Current Time Zone Info
697 Status
= gRT
->GetTime(&TheTime
, NULL
);
698 ASSERT_EFI_ERROR(Status
);
700 if (TheTime
.TimeZone
!= 2047) {
703 ; LoopVar
< sizeof(TimeZoneList
) / sizeof(TimeZoneList
[0])
706 if (TheTime
.TimeZone
== TimeZoneList
[LoopVar
].TimeZone
) {
707 if (ShellCommandLineGetFlag(Package
, L
"-f")) {
709 // Print all info about current time zone
711 ShellPrintHiiEx (-1, -1, NULL
, TimeZoneList
[LoopVar
].StringId
, gShellLevel2HiiHandle
);
714 // Print basic info only
716 if (TheTime
.TimeZone
== 2047) {
719 TzMinutes
= AbsVal(TheTime
.TimeZone
) % 60;
726 STRING_TOKEN(STR_TIMEZONE_SIMPLE
),
727 gShellLevel2HiiHandle
,
728 TheTime
.TimeZone
==2047?0:(TheTime
.TimeZone
> 0?L
"-":L
"+"),
729 TheTime
.TimeZone
==2047?0:AbsVal(TheTime
.TimeZone
) / 60,
738 // Print basic info only
740 if (TheTime
.TimeZone
== 2047) {
743 TzMinutes
= AbsVal(TheTime
.TimeZone
) % 60;
749 STRING_TOKEN(STR_TIMEZONE_SIMPLE
),
750 gShellLevel2HiiHandle
,
751 TheTime
.TimeZone
==2047?0:(TheTime
.TimeZone
> 0?L
"-":L
"+"),
752 TheTime
.TimeZone
==2047?0:AbsVal(TheTime
.TimeZone
) / 60,
754 if (ShellCommandLineGetFlag(Package
, L
"-f")) {
755 ShellPrintHiiEx (-1, -1, NULL
, STRING_TOKEN(STR_TIMEZONE_NI
), gShellLevel2HiiHandle
);
760 // TimeZone was 2047 (unknown) from GetTime()
767 // free the command line package
769 ShellCommandLineFreeVarList (Package
);
771 return (ShellStatus
);