CrossClj

0.14.4 docs

SourceDocs



RECENT
    VARS
    from-date
    from-long
    from-sql-date
    from-sql-time
    from-string
    ICoerce
    to-date
    to-epoch
    to-local-date
    to-local-date-time
    to-long
    to-sql-date
    to-sql-time
    to-string
    to-timestamp

    « Index of all namespaces of this project

    Utilites to coerce Joda DateTime instances to and from various other types.
    For example, to convert a Joda DateTime to and from a Java long:
    
      => (to-long (date-time 1998 4 25))
      893462400000
    
      => (from-long 893462400000)
      #<DateTime 1998-04-25T00:00:00.000Z>
    (from-date date)
    Returns a DateTime instance in the UTC time zone corresponding to the given
    Java Date object.
    (from-long millis)
    Returns a DateTime instance in the UTC time zone corresponding to the given
    number of milliseconds after the Unix epoch.
    (from-sql-date sql-date)
    Returns a DateTime instance in the UTC time zone corresponding to the given
    java.sql.Date object.
    (from-sql-time sql-time)
    Returns a DateTime instance in the UTC time zone corresponding to the given
    java.sql.Timestamp object.
    (from-string s)
    return DateTime instance from string using
    formatters in clj-time.format, returning first
    which parses
    protocol
    (to-date-time obj)
    Convert obj to a Joda DateTime instance.
    
    (to-date obj)
    Convert obj to a Java Date instance.
    
    (to-epoch obj)
    Convert obj to Unix epoch.
    
    (to-local-date obj)
    Convert obj to a org.joda.time.LocalDate instance
    
    (to-local-date-time obj)
    Convert obj to a org.joda.time.LocalDateTime instance
    
    (to-long obj)
    Convert obj to the number of milliseconds after the Unix epoch.
    
    (to-sql-date obj)
    Convert obj to a java.sql.Date instance.
    
    (to-sql-time obj)
    Convert obj to a java.sql.Timestamp instance.
    
    (to-string obj)
    Returns a string representation of obj in UTC time-zone
    using (ISODateTimeFormat/dateTime) date-time representation.
    (to-timestamp obj)
    Convert obj to a Java SQL Timestamp instance.