Java Time Readable Format toTimestamp(long time)

Here you can find the source of toTimestamp(long time)

Description

PostgreSQL to_timestamp() doesn't support timezone specifications, so this is the only way how to set correct timestamp with timezone using string (as our current DAOs uses only strings to create SQL).

License

Apache License

Declaration

public static String toTimestamp(long time) 

Method Source Code

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

public class Main {
    /**//w  w  w  .ja va2s. c om
     * PostgreSQL to_timestamp() doesn't support timezone specifications, so this is the only way how to set correct
     * timestamp with timezone using string (as our current DAOs uses only strings to create SQL).
     */
    public static String toTimestamp(long time) {
        return String.format("to_timestamp(%d::double precision / 1000)", time);
    }
}

Related

  1. toTime2(int value, int nanos, int meta)
  2. toTimeExpression(long ms, int frames)
  3. toTimeFormat(String _srcTime)
  4. toTimeHumanReadable(final long time)
  5. toTimeSpanDescription(long time)
  6. toTimeStampString(String timeStr)
  7. toTimeString(double millis)
  8. toTimeString(long frame)
  9. toTimeString(long millis)