[INTERPRETER]
* NEW: 't' and 'tt' are two new date formatting patterns that display the timezone. git-svn-id: svn://localhost/gambas/trunk@4507 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
e9f7c91cd5
commit
fad8dc7581
1 changed files with 11 additions and 5 deletions
|
@ -1262,7 +1262,16 @@ static bool add_date_token(DATE_SERIAL *date, char *token, int count)
|
|||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case 't':
|
||||
|
||||
if (count <= 2)
|
||||
{
|
||||
time_t t = (time_t)0L;
|
||||
localtime_r(&t, &tm);
|
||||
add_strftime(count == 2 ? "%z" : "%Z", &tm);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
*token = 0;
|
||||
|
@ -1397,13 +1406,10 @@ bool LOCAL_format_date(const DATE_SERIAL *date, int fmt_type, const char *fmt, i
|
|||
continue;
|
||||
}
|
||||
|
||||
if (c == 'd' || c == 'm' || c == 'y' || c == 'h' || c == 'n' || c == 's' || c == 'u')
|
||||
if (c == 'd' || c == 'm' || c == 'y' || c == 'h' || c == 'n' || c == 's' || c == 'u' || c == 't')
|
||||
{
|
||||
if (c != token)
|
||||
{
|
||||
if (token == 'h' && c == 'm')
|
||||
c = 'n';
|
||||
|
||||
add_date_token(&vdate, &token, token_count);
|
||||
|
||||
token = c;
|
||||
|
|
Loading…
Reference in a new issue