Code example for Time

Methods: formatsetToNow

0
     * @param numHours amount of hours during which the user interacted with contacts since the last question (user input) 
     * @param numMinutes amount of minutes (59 max) during which the user interacted with contacts since the last question (user input) 
     */ 
    public void saveUserInputToCSV(boolean cancelled, String numContacts, String numHours, String numMinutes) {
        // create a string containing the current date and one containing the current time 
        Time today = new Time(Time.getCurrentTimezone());
        today.setToNow();
        String date = today.format("%d.%m.%Y");
        String answerTime = today.format("%H:%M");
 
        // get the time of the current alarm 
        String currentAlarm = _userData.getTimeAtLastAlarm();
 
        // get probandencode 
        String probandencode = _userData.getProbandenCode();
 
        // if no answer was given, set values to invalid and save that 
        String cancelledText = "0";
        if( cancelled ){
            cancelledText = "1";
Experience pair programming with AI  Get Codota for Java