package org.gnode.nix.internal;

import java.util.Date;

public class DateUtils {

    /**
     * Convert seconds to appropriate date
     * <p/>
     * Required for functions that use time_t
     *
     * @param seconds seconds to be converted
     * @return date object
     */
    public static Date convertSecondsToDate(long seconds) {
        // convert to milliseconds by multiplying by 1000
        // DateTime expects input in milliseconds
        seconds *= 1000L;

        return new Date(seconds);
    }

    /**
     * Convert date object to seconds
     * <p/>
     * Required for functions that use time_t
     *
     * @param dateTime date to be converted
     * @return seconds
     */
    public static long convertDateToSeconds(Date dateTime) {
        long seconds = dateTime.getTime() / 1000;
        return seconds;
    }
}

@@ -50,16 +50,102 @@
 .Date;%0A%0A
+/**%0A * %3Ch1%3EDateUtils%3C/h1%3E%0A * This class contains functions for date conversions.%0A */%0A%0A
 public c
@@ -214,33 +214,32 @@
 e date%0A     * %3Cp
-/
 %3E%0A     * Require
@@ -649,17 +649,16 @@
     * %3Cp
-/
 %3E%0A     *

update documentation