Java Time Format formatDateTime(String value)

Here you can find the source of formatDateTime(String value)

Description

format Date Time

License

Open Source License

Declaration

public static String formatDateTime(String value) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    private static final int DATE_TIME_STRING_LENGTH = 29;
    private static final String GMT_OFFSET = ".000-00:00";

    public static String formatDateTime(String value) {
        if (value == null) {
            return null;
        }/*from   w  w  w.j  a  va2 s .com*/

        if (value.length() != DATE_TIME_STRING_LENGTH) {
            return addGMToffset(value);
        } else {
            return value;
        }
    }

    private static String addGMToffset(String value) {
        return value + GMT_OFFSET;
    }
}

Related

  1. format(String format, long time)
  2. formatBenchResult(final String benchName, final int iterationCount, final int benchNumber, final double benchTime)
  3. formatCooldown(long time)
  4. formatDateTime(String DateTimeStr)
  5. formatDateTime(String s)
  6. formatDateTimeString(final String dateTimeString, final boolean wrapForCodeUsage)
  7. formatDelay(long startTime, long endTime)
  8. formatElapsedTime(int seconds)
  9. formatElapsedTime(long elapsedTime)