i want to get time from datePicker into NSDate object, and then to run a method every day in this time. for example: the user put in the datePicker the tome 08:00 and every day in 08:00 the application will run some method.
Thank you very much, Amir Foghel
timePicker = new DateTimePicker(); timePicker. Format = DateTimePickerFormat. Time; timePicker.
The DateTimePicker control is used to allow the user to select a date and time, and to display that date and time in the specified format. The DateTimePicker control makes it easy to work with dates and times because it handles a lot of the data validation automatically.
Android Date Time Picker Dialog Project CodegetInstance() to display the current date and time using the respective static fields. Note: The display calendar and clock are the default UI themes as provided in the AppCompat Theme. Below is the output produced by our android date time picker example application.
final DatePicker datePicker = new DatePicker(); datePicker. setOnAction(new EventHandler() { public void handle(Event t) { LocalDate date = datePicker. getValue(); System.
To get the time from datepicker use ,
NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init];
[outputFormatter setDateFormat:@"HH:mm"]; //24hr time format
NSString *dateString = [outputFormatter stringFromDate:self.myDatePicker.date];
[outputFormatter release];
To do a functionality at particular time daily use UILocalNotification.
Set the repeatInterval as NSDayCalendarUnit.
And in the delegate to handling the UILocalNotification code your method.
NOTE: This method will be execute only when the user accepts the Local notification.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With