I have created a program using Visual Basic that when the user enters all values needed and a button clicked, the program links to outlook and sets a reminder with the information previously enterd. I have created a successful program in doing so however the time set for the reminder is 12:00 AM as I have used a Date time picker with a short date(no time).
My question is can I user "convert.ToDateTime(VariableForDate, 8:00 AM) with the second paramater being a set value
current code(Does not work)
tmpapp.Start = Convert.ToDateTime(sFollowUpDate, 8:00 AM)
tmpapp.End = Convert.ToDateTime(sFollowUpDate, 8:00 AM)
Thanks in advance for any and all help
If you only ever have to add hours to a date you can use the AddHours method:
tmpapp.start = Convert.ToDateTime(sFollowUpDate).AddHours(8)
If you need to add more complex times (hours, minutes and seconds) you can use:
tmpapp.start = Convert.ToDateTime(sFollowUpDate).Add(new TimeSpan(8,0,0))
The TimeSpan constructor I've used has arguments for hour, minute and second respectively.
Related
When I pass the minimum time (min parameter) for the date picker, 02:00 is the minimum for example, but it starts selecting the not allowed value 00:00, if the user clicks OK, it sets the wrong not allowed value.
If I change to an allowed time, 03:00 for example, then I can't click again at 00:00 (expected behavior).
The image shows how the time picker starts once you click it. Note that I passed '02:00' as the minimum time and it started at 00:00 and the user is allowed to click OK and set the wrong time.
PS: I am using the vuetify-datetime-picker library
You cannot use min for this, rather use the built in props in v-time-picker called allowed-hours.
If you want to block 00:00, 01:00 and 02:00, then set allowed-hours like this:
<v-time-picker
:allowed-hours="v => v > 2 && v <= 23"
format="24hr"
/>
More information can be found here.
I need to pass data in time format in "time" type element in "10:00 AM" format.
I am using following code:
public static void setShift()
{
txttime.sendkeys("1030AM");
}
this is not working. what is a correct way to enter such data?
Use Following Code :
It will work it for textbox/text area control
SimpleDateFormat formatter = new SimpleDateFormat("hh:mm a");
Date date = new Date();
txttime.sendkeys(date);
For the HTML input type datetime-local handling it from selenium is not ideal. It is not the most used date time picker, and it is not supported in firefox or safari.
For chrome, the date time format shows the format set in the browser's machine.
If you haven't changed anything, I'm guessing you are getting the format shown in the guru99 tutorial.
If that is the case, then you have missed that they also have provided the solution there.
After entering the date part you need to press tab to input the time part. Which is missing from your given code.
Try this:
First, input the date
WebElement dateBox = driver.findElement(By.xpath("//form//input[#name='bdaytime']"));
dateBox.sendKeys("09252013");
Second, press tab
dateBox.sendKeys(Keys.TAB);
Last, input the time
dateBox.sendKeys("0245PM");
Note:
If your machine has different DateTime formatting then this might not work. You have to check which part of the date time senKeys can actually input then split up that part and use Keys.TAB to press tab. Then input the next part until completion.
I'm setting the value of a bootstrap datepicker by making use of the setValue method provided.
For example
tripToDatePicker.setValue(tripFromDatePicker.date);
But for some reason the calendar is not updated
'setValue' is replaced by 'setDate'.
Using a string as input for setDate can be tricky. It has to match with the dateformat, else you can get unexpected results. It is more safe to create a 'new Date(y,m,d)' from your input, e.g. new Date(2015,3,10) for '10 Apr 2015'. This will always work.
When using a date representation in seconds, e.g. 1428659901, then use 'new Date(value*1000)'. Note that datepicker will eat any value here, but only show the selected date in the calendar if hours, minutes and seconds are equal to 0. Took me a while to figure that out....
Edit:
http://www.eyecon.ro/bootstrap-datepicker/ is not much documented, you should try http://eternicode.github.io/bootstrap-datepicker/.
anyway the code below will work for you
$("#dp1").datepicker("update", "02-16-2012");
or
$("#dp1").datepicker("setValue", "02-17-2012");
where "#dpi" is the id of the text field on whcih datepicker is used.
After trying many things, I ended up using "update" method. The $("#dp1").datepicker("update", "02-02-2012") or $("#dp1").datepicker("update", "02/02/2012") works for me. Surprisingly no document about this method at author website. Thanks.
I have a UIDatePicker set for UIDatePickerModeTime. I am using the following code to set the time in my datePicker:
[self.oTimePicker setDate:dateFromString(self.oStartTime.text, #"HH:mm")];
[self.oTimePicker reloadInputViews];
which works but then the datePicker appears gray in color (see image below; it appears the datePicker is disabled), and sets the time to 06:00, no matter what is selected. Here is an image of the results; notice that I have picked 1:30 PM, but the text box shows 06:00; in addition, no matter what I select, nothing changes (the time displays what I pick (here 1:30 PM), but the value in the datePicker remains at 14:00 (but doesn't show 14:00 verified with NSLog), no matter what I select. Any ideas of what could be causing this?
It looks like you are having a time-zone issue with UIDatePicker. That is why it is showing one time in a UIDatePicker and another in your label (Washington has -7 time difference). There are lot of questions and answers about this topic (one example: iphone UIDatePicker showing wrong date in Central Timezone).
Another problem you are having is that UIDatePicker becomes disabled. This issue can be caused if you are setting datePicker.minimumDate to current date and using UIDatePickerModeTime.
How do I get the date and time? The tutorial seems to be a bit wacky. Basically, I want the date and time to be recorded to a file when I press the button C. I think the following is correct:
c:: FileAppend,
(
*However you do date and time
), C:\Users\MyUserName\Desktop\times.txt
try
^#C::
FormatTime, TimeString, %A_NOW%, MMMM d, yyyy
Send, %TimeString%
return
adapted from autohotkey