2017년 1월 11일 수요일

About Format of Clock Component


I'd like to have a saved file name like yyyymmdd, e.g. 20160417.png.

When I use pattern : yyyyMMdd, the saved file name is 2016Apr17.png.
When I use pattern : yyyymmdd, the saved file name is 20162417.png.
When I use pattern : yyyymd, the saved file name is 20163017.png. 

Why the month can't be a right number?



--
If you follow the (?) button from the Designer Clock component entry, it gives you a popup window with a little text, and a link to https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
with the full list of format items.

See attached.

FormatDate.png 표시 중
-- 
Thank you so much! The link you offered is so detailed. "m" means "Minute in hour".

 I set the pattern to yyyyMMd, then the time displayed as 20160418, that's so great! 

-- 
You may want to use yyyyMMdd for the format pattern instead.
yyyyMMd will give 2016046 rather than 20160406 when the day value is less than 10.

-- 

댓글 없음:

댓글 쓰기