KB-35890: Sorting out the information returned by ShowDatePicker() method.

Question:

How can I sort out into year, month, day, hour, and minute the value returned by the ShowDatePicker()?

Solution:

To do so, you must use specific VBScript’s methods, such as Year() or Month().

Example:

Application.ShowDatePicker Date_Time, 500, 500
MsgBox Date_Time ‘Shows the date and time value returned by the ShowDatePicker() method
MSgBox Year(Date_Time) ‘Shows only the year
MsgBox Right(“0″&Month(Date_Time), 2) ‘Shows only the month; if it has only one place(9), adds a zero to the left (09)
MsgBox Right(“0″&Day(Date_Time), 2)
MsgBox Hour(Date_Time)
MsgBox Minute(Date_Time)

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Leave a Reply

Your email address will not be published.Required fields are marked *