简体   繁体   中英

How to get the date from an UIDatePicker with mode set to Time only

My UIDatePicker needs to show only the time, but I also need to get the current date when that time was set.

Is this possible if the date picker has the mode set to Time ?

Currently I get this when I print the current date from date picker:

2000-01-01 3:00:00 AM +0000

您可以创建一个Date对象“ Date()”来获取当前日期,并且可以使用“ valueChanged”事件合并两个值,它们选择的时间和获得的日期

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM