Java LocalDateTime Calculate printDateTime(LocalDateTime dateTime)

Here you can find the source of printDateTime(LocalDateTime dateTime)

Description

print Date Time

License

Open Source License

Declaration

public static String printDateTime(LocalDateTime dateTime) 

Method Source Code

//package com.java2s;
/*//from  w w  w  .  j a va  2  s.c  o  m
 * SonarLint for IntelliJ IDEA
 * Copyright (C) 2015 SonarSource
 * sonarlint@sonarsource.com
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
 */

import java.time.LocalDateTime;

import java.time.format.DateTimeFormatter;

public class Main {
    public static String printDateTime(LocalDateTime dateTime) {
        return dateTime.format(DateTimeFormatter
                .ofPattern("yyyy-MM-dd HH:mm:ss"));
    }
}

Related

  1. localDateTime2LocalDate(LocalDateTime localDateTime)
  2. ms2LocalDateTime(final long ms)
  3. oldDateToISO8601LocalDateTime(Date nextColumnDate)
  4. parseStringToLocalDateTimeWithSpecifiedTime(String strDate, String time)
  5. parseTimeStamp(LocalDateTime actualDate, LocalDateTime checkedDate, boolean isDateFrom)
  6. relativeDateTime(final LocalDateTime contextDate, final String str, final boolean add)
  7. safeCreateFromValue(LocalDateTime datetime, int year, int month, int day, int hour, int minute, int second)
  8. secondsBetween(LocalDateTime date1, LocalDateTime date2)
  9. setTime(LocalDateTime source, String time)