java - android Date and SimpleDateFormat output wrong -



java - android Date and SimpleDateFormat output wrong -

i not know why different input output duplicate, here code

date d = new date(1409716800); date d1 = new date(1409716801); simpledateformat sdf = new simpledateformat("dd.mm.yy-hh:mm:ss"); string formatteddate = sdf.format(d); string formatteddate1 = sdf.format(d1); log.d("time", formatteddate); log.d("time", formatteddate1);

the output

10-24 06:12:50.508: d/time(29097): 17.01.70-07:35:16 10-24 06:12:50.508: d/time(29097): 17.01.70-07:35:16

can tell me why output duplicate? timezone gmt+7

date d = new date(1409716800); date d1 = new date(1409716801); simpledateformat sdf = new simpledateformat("dd.mm.yy-hh:mm:ss:sss"); string formatteddate = sdf.format(d); string formatteddate1 = sdf.format(d1); log.d("time", formatteddate); log.d("time", formatteddate1);

ouput:

17.01.70-14:35:16:800 17.01.70-14:35:16:801

java android date simpledateformat

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -