Java Now now()

Here you can find the source of now()

Description

now

License

Mozilla Public License

Declaration

private static String now() 

Method Source Code

//package com.java2s;
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    private static final SimpleDateFormat dateFormat = new SimpleDateFormat(
            "yyyy-MM-dd'T'HH:mm:ss.SSSZ");

    private static String now() {
        String now = dateFormat.format(new Date());
        now = now.substring(0, 26) + ":" + now.substring(26, 28);
        return now;
    }/*from  w w  w  .  j  av  a 2 s  .  co  m*/
}

Related

  1. now()
  2. now()
  3. now()
  4. now()
  5. now()
  6. now()
  7. now()
  8. now()
  9. now()