xxxxxxxxxx
<label for="start">Start date:</label>
<input type="date" id="start" name="trip-start"
value="2018-07-22"
min="2018-01-01" max="2018-12-31">
xxxxxxxxxx
<label for="datetime">Select Date and Time:</label>
<input type="datetime-local" id="datetime" name="datetime">
xxxxxxxxxx
<form>
<label for="birthday">Birthday:</label>
<input type="date" id="birthday" name="birthday">
</form>
xxxxxxxxxx
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input id="datePicker" type="date" />
Run code snippet
xxxxxxxxxx
// convert Javascript Date to HTML Input
var now = new Date();
var day = ("0" + now.getDate()).slice(-2);
var month = ("0" + (now.getMonth() + 1)).slice(-2);
var hour = ("0" + (now.getHours())).slice(-2);
var min = ("0" + (now.getMinutes())).slice(-2);
var today = now.getFullYear() + "-" + month + "-" + day + "T" + hour + ":" + min;
xxxxxxxxxx
from datetime import datetime
# Ask user for date and time inputs
date_input = input("Enter a date (YYYY-MM-DD): ")
time_input = input("Enter a time (HH:MM:SS): ")
# Format the date and time inputs into a datetime object
datetime_input = datetime.strptime(date_input + " " + time_input, "%Y-%m-%d %H:%M:%S")
# Print the datetime object
print("Input datetime:", datetime_input)
xxxxxxxxxx
using DevExpress.XtraEditors;
// initialize a new XtraInputBoxArgs instance
XtraInputBoxArgs args = new XtraInputBoxArgs();
// set required Input Box options
args.Caption = "Shipping options";
args.Prompt = "Delivery date";
args.DefaultButtonIndex = 0;
args.Showing += Args_Showing;
// initialize a DateEdit editor with custom settings
DateEdit editor = new DateEdit();
editor.Properties.CalendarView = DevExpress.XtraEditors.Repository.CalendarView.TouchUI;
editor.Properties.Mask.EditMask = "MMMM d, yyyy";
args.Editor = editor;
// a default DateEdit value
args.DefaultResponse = DateTime.Now.Date.AddDays(3);
// display an Input Box with the custom editor
var result = XtraInputBox.Show(args).ToString();
// set a dialog icon
private void Args_Showing(object sender, XtraMessageShowingArgs e) {
e.Form.Icon = this.Icon;
}