Exemple de méthode java.time.ZonedDateTime.getDayOfMonth ()

La description

le java.time.ZonedDateTime.getDayOfMonth() method obtient le champ jour du mois.

Déclaration

Voici la déclaration pour java.time.ZonedDateTime.getDayOfMonth() méthode.

public int getDayOfMonth()

Valeur de retour

le jour du mois, du 1 au 31.

Exemple

L'exemple suivant montre l'utilisation de la méthode java.time.ZonedDateTime.getDayOfMonth ().

package com.tutorialspoint;

import java.time.ZonedDateTime;

public class ZonedDateTimeDemo {
   public static void main(String[] args) {
 
      ZonedDateTime date = ZonedDateTime.parse("2017-03-28T12:25:38.492+05:30[Asia/Calcutta]");
      System.out.println(date.getDayOfMonth());  
   }
}

Compilons et exécutons le programme ci-dessus, cela produira le résultat suivant -

28