Class Date (2.60.3) 
  
  
  
   
  
    
  
  
    
    
    
    
  Version 2.60.3keyboard_arrow_down  
  
 
    
    
    
    
      
  
  
  
    Beta 
    
    This library is covered by the Pre-GA Offerings Terms 
    of the  Terms of Service. Pre-GA libraries might have limited support,
    and changes to pre-GA libraries might not be compatible with other pre-GA versions.
    For more information, see the
    launch stage descriptions .
    
   
  
    
public   final   class  Date   implements   Comparable<Date> ,   Serializable  
  Represents a Date without time, such as 2017-03-17. Date is timezone independent.
Static Methods
   
  fromJavaUtilDate(Date date) 
  
    
public   static   Date   fromJavaUtilDate ( Date   date )  
  Convert a Java Util Date to a Google Date.
    
      
        Parameter  
      
        Name Description  
      
        dateDate the date of the java.util.Date
 
     
  
  
    
      
        Returns  
      
        Type Description  
      
        Date Google Java Date
 
     
  
  fromYearMonthDay(int year, int month, int dayOfMonth) 
  
    
public   static   Date   fromYearMonthDay ( int   year ,   int   month ,   int   dayOfMonth )  
  Constructs a new Date instance.
    
      
        Parameters  
      
        Name Description  
      
        yearint must be greater than 0
 
      
        monthint must be between [1,12]
 
      
        dayOfMonthint must be between [1,31]
 
     
  
  
    
      
        Returns  
      
        Type Description  
      
        Date  
     
  
  parseDate(String date) 
  
    
public   static   Date   parseDate ( String   date )  
  
    
      
        Parameter  
      
        Name Description  
      
        dateString Data in RFC 3339 date format (yyyy-mm-dd).
 
     
  
  
    
      
        Returns  
      
        Type Description  
      
        Date  
     
  
  toJavaUtilDate(Date date) 
  
    
public   static   Date   toJavaUtilDate ( Date   date )  
  Convert a Google Date to a Java Util Date.
    
      
        Parameter  
      
        Name Description  
      
        dateDate the date of the Google Date.
 
     
  
  
    
      
        Returns  
      
        Type Description  
      
        Date java.util.Date
 
     
  
  Methods
   
  compareTo(Date other) 
  
    
public   int   compareTo ( Date   other )  
  
    
      
        Parameter  
      
        Name Description  
      
        otherDate  
     
  
  
    
      
        Returns  
      
        Type Description  
      
        int  
     
  
  equals(Object o) 
  
    
public   boolean   equals ( Object   o )  
  
    
      
        Parameter  
      
        Name Description  
      
        oObject  
     
  
  
  Overrides 
  
  getDayOfMonth() 
  
    
public   int   getDayOfMonth ()  
  Returns day of month between 1 and 31 inclusive.
    
      
        Returns  
      
        Type Description  
      
        int  
     
  
  getMonth() 
  
  Returns the month between 1 and 12 inclusive.
    
      
        Returns  
      
        Type Description  
      
        int  
     
  
  getYear() 
  
  
  
    
      
        Returns  
      
        Type Description  
      
        int  
     
  
  hashCode() 
  
  
    
      
        Returns  
      
        Type Description  
      
        int  
     
  
  Overrides 
  
  toString() 
  
  
    
      
        Returns  
      
        Type Description  
      
        String  
     
  
  Overrides 
  
 
     
    
  
  
  
     
  
    
    
      
       
    
    
  
  
 
  Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
  Last updated 2025-10-28 UTC.
 
 
  
  
  
    
      [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-28 UTC."],[],[]]