site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=AuMRiB27w9EhybboGo4kLwooEWD55niR6/Mgwg09CX0=; b=pehkxmKTWBEDUqU5ifp5xWl/T9Oh78/CwD6h4nm12w+UUsdcF5vPzzJyPrv03UZqgc ks8O+RCBGZ06vFPedkYTA+GP3vdsySUFmE2+qD6duMEjVGzhZPuIAwOKaACqkDsTFEqb E5RidbGz/NzU3yyv0nHeMcQAW+0VimT5S39y2qvuU6IsrK6OjiakE+vfMKrG14zU7aCt ZcVROi4Sh4ALLm8rfyIY0ao4rsKokI7IH9aDrTqPvZc0rglfxuugibz5vglX5HfPjLmh hVdOs44134J1Cu6B7p1Jp1sX6mjxIgWF6XIfL5i2akAroKuv6Hhy19KLGEk8DTQoEhg3 mjoA== Maybe I'm missing something (regarding the tm var) but shouldn't all the struct tm fields be correctly set by gmtime_r? #include <unistd.h> #include <time.h> #include <string.h> #include <stdio.h> int main(int argc, const char * argv[]) { char tmpc[128]; struct tm tm; memset(tmpc, 0, sizeof(tmpc)); __darwin_time_t tValue=2914986787602432000; gmtime_r(&tValue, &tm); strftime(tmpc, sizeof(tmpc), "%FT%T", &tm); printf("time: %s\n",tmpc); printf("-----------------\n"); struct tm tm2; tm2.tm_mon=10240; memset(tmpc, 0, sizeof(tmpc)); tValue=2914986787602432000; gmtime_r(&tValue, &tm2); strftime(tmpc, sizeof(tmpc), "%FT%T", &tm2); printf("time: %s\n",tmpc); return 0; } => time: 1900-01-00T18:40:00 ----------------- time: 1900-10241-00T18:40:00 _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.app... This email sent to site_archiver@lists.apple.com