ghatfan99
30 Jul 2010, 6:32 AM
hello every one,
i have DateField for the date and TextField fro the hour:
DateField fin = new DateField();
fin.setFieldLabel("Fin");
right.add(fin, formData);
//*****************
TextField fTime = new TextFieldMask();
after that i have the function for converting them:
private Date convertDateField(Date date, String time) {
String fullDateTime = DateTimeFormat.getFormat("yyyy-mm-dd").format(date)+ " " + time;
return DateTimeFormat.getFormat(pFormat).parse(fullDateTime);
}
and the result like that: Fri Jul 30 22:11:10 CEST 2010
my problem is that i want to compare this result with the current date and time of the system, but i don't know how to get them (current date and time of the system) in my format :
("yyyy-mm-dd").format(date)+ " " + time
if you have some ideas ???
i have DateField for the date and TextField fro the hour:
DateField fin = new DateField();
fin.setFieldLabel("Fin");
right.add(fin, formData);
//*****************
TextField fTime = new TextFieldMask();
after that i have the function for converting them:
private Date convertDateField(Date date, String time) {
String fullDateTime = DateTimeFormat.getFormat("yyyy-mm-dd").format(date)+ " " + time;
return DateTimeFormat.getFormat(pFormat).parse(fullDateTime);
}
and the result like that: Fri Jul 30 22:11:10 CEST 2010
my problem is that i want to compare this result with the current date and time of the system, but i don't know how to get them (current date and time of the system) in my format :
("yyyy-mm-dd").format(date)+ " " + time
if you have some ideas ???