Beispiel #1
0
                /**
                 * Returns greeting message.
                 * <p>
                 * Returns "Morning, ", "Hello, " or "Evening, " with name argument,
                 * depending on the argument hour.
                 * </p>
                 * @param name name to display.
                 * @param date time to determine the greeting message.
                 * @return the resulting message.
                 */
                public String greet(String name, java.util.Date date)
                {
                    String head = date.getHours() < 11 ? "Morning, " :
                                  date.getHours() < 17 ? "Hello, " : "Evening, ";

                    return(head + name);
                }
 public static DateTime?GetDateTimme(java.util.Date date)
 {
     return((date == null) ? (DateTime?)null : new DateTime(date.getYear() + 1900, date.getMonth() + 1, date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds()));
 }