Java Time Format formatTimestampEnd(String timestamp)

Here you can find the source of formatTimestampEnd(String timestamp)

Description

Formats a string timestamp to be used as the end bound filter string in HBase scan.

License

Apache License

Parameter

Parameter Description
timestamp is the timestamp to be formated

Return

a formated string to be used in HBase scan

Declaration

public static String formatTimestampEnd(String timestamp) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**/*from   w ww  .j  a  v a2s.  c o  m*/
     * Formats a string timestamp to be used as the end bound filter string in
     * HBase scan. Adds 1 ms to it and makes it 13 digits
     * 
     * @param timestamp
     *            is the timestamp to be formated
     * @return a formated string to be used in HBase scan
     */
    public static String formatTimestampEnd(String timestamp) {

        if (timestamp == null || timestamp == "")
            return timestamp;

        timestamp = String.format("%013d", Long.parseLong(timestamp) + 1);

        return timestamp;
    }
}

Related

  1. formatTimePeriod(long timestamp)
  2. formatTimeSec(long time)
  3. formatTimespan(int timespan)
  4. formatTimeSpanForScheduler(long time)
  5. formatTimestamp(String timestamp)
  6. formatTimestampForFilename(final long timestamp)
  7. formatTimestampForLogging(final long rawNanosTimestamp)
  8. formatTimestampStart(String timestamp)
  9. formatTimeStep(Integer numberOfTimestepsPerYear, int stepNumber)