ホーム » gcc » なんかおかしい? DS116 localtime

2020年12月
 12345
6789101112
13141516171819
20212223242526
2728293031  

カテゴリー

アーカイブ

ブログ統計情報

  • 79,212 アクセス



なんかおかしい? DS116 localtime

2020/12/02 0 時過ぎ,個人的に書いているコードがうまく動作していないことに気づいた.
全てではないが,日時の表示が GMT になってしまっている?
うまく動作しているものもあり,次のものは正しく表示される.
DrawNow アクセス日時を WebGL で表示する
この様になった心当たりはある.
昨日 opkg の update と upgrade ,opkg install gcc などを行ったことが影響している?
tree … -D や cal なども GMT になっている.


どこが影響しているかを調べるために少しコードを書いてみた.

#include	<clocale>
#include	<iostream>
#include	"_tdefine.hxx"
#include	"timefmt.hxx"

int	_tmain	(int argc,TCHAR* argv[])
{
	_tsetlocale(LC_ALL,_T("")) ;
	{
		tstring	now_time = ::Now_Format() ;
		std::tout << _T("::Now_Format()   \t") << now_time << std::endl ;
		}
	{
		tstring	gmt_time = ::Now_FormatGMT() ;
		std::tout << _T("::Now_FormatGMT()\t") << gmt_time << std::endl ;
		}
	return	0 ;
	}

Win10 環境では意図した動作.

Microsoft Windows [Version 10.0.18363.1198]
(c) 2019 Microsoft Corporation. All rights reserved.

C:\Users\Iwao>\\TestXP\C_Temp\Test_cpp\t_mtime\t_localt\Release.060\t_localt.exe
::Now_Format()          2020/12/02 10:22:34
::Now_FormatGMT()       2020/12/02 01:22:34

C:\Users\Iwao>  

Win10 で localtime


DS116 では localtime が正しく求まっていない.

Iwao@DS116:~/gcc_test/Test/t_linux/t_mtime/t_localt$ ll
total 44
drwxrwxrwx+ 2 Iwao users  4096 Dec  2 10:19 .
drwxrwxrwx+ 5 Iwao users  4096 Dec  2 10:03 ..
-rwxrwxrwx  1 Iwao users 14188 Dec  2 10:19 a.out
-rwxrwxrwx+ 1 Iwao users   892 Dec  2 10:02 t_localt.BAK
-rwxrwxrwx+ 1 Iwao users   917 Dec  2 10:17 t_localt.cpp
-rwxrwxrwx+ 1 Iwao users  4476 Dec  2 10:02 t_localt.dsp
Iwao@DS116:~/gcc_test/Test/t_linux/t_mtime/t_localt$ ./a.out
::Now_Format()          2020/12/02 01:24:30
::Now_FormatGMT()       2020/12/02 01:24:30
Iwao@DS116:~/gcc_test/Test/t_linux/t_mtime/t_localt$  

DS116 で localtime


上の WebGL で現在日時を表示ている .out は,2017/07/19 にコンパイルしたもの.
他の .out で,古いものは正しく動作し,2020/02 のものはうまくない.


どこかに設定などがあるのか?


2020/12/09
GMT と同じ扱いになり困っていたのは,個人的なコードの i_drawlg.hxx
今日のファイルを求める所で 24*60*60 を加えることで対応.


2022/06/15 DS116 entware
entware の更新で正しく動作する様になった.

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

1件のコメント

コメントする

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

%d人のブロガーが「いいね」をつけました。