Java Time Format formatDateTime(String s)

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

Description

format Date Time

License

Open Source License

Declaration

public static String formatDateTime(String s) 

Method Source Code

//package com.java2s;
//   Licensed under the Apache License, Version 2.0 (the "License"); you may

public class Main {
    public static String formatDateTime(String s) {
        //if string still contains a space after trim, assume it is the wrong format
        //if it doesn't contain a space, it's probably good to go
        if (!s.contains(" "))
            return s;

        return s.trim().replace(" ", "T") + "Z";
    }//from  ww w  . ja  v a2 s.  co m
}

Related

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