Пример #1
0
        /**
         * Parses at-style time specification and returns the corresponding timestamp. For example:<p>
         * <pre>
         * long t = Util.getTimestamp("now-1d");
         * </pre>
         *
         * @param atStyleTimeSpec at-style time specification. For the complete explanation of the syntax
         *                        allowed see RRDTool's <code>rrdfetch</code> man page.<p>
         * @return timestamp in seconds since epoch.
         */
        public static long getTimestamp(String atStyleTimeSpec)
        {
            TimeSpec timeSpec = new TimeParser(atStyleTimeSpec).parse();

            return(timeSpec.getTimestamp());
        }