Package railo.runtime.type.dt

Examples of railo.runtime.type.dt.DateTime


  return defaultValue;
    }
   
    public static String toUSDate(Object o, TimeZone timeZone) throws PageException {
      if(Decision.isUSDate(o)) return Caster.toString(o);
      DateTime date = DateCaster.toDateAdvanced(o, timeZone);
      return new railo.runtime.format.DateFormat(Locale.US).format(date,"mm/dd/yyyy");
    }
View Full Code Here


      return new railo.runtime.format.DateFormat(Locale.US).format(date,"mm/dd/yyyy");
    }
   
    public static String toEuroDate(Object o, TimeZone timeZone) throws PageException {
      if(Decision.isEuroDate(o)) return Caster.toString(o);
      DateTime date = DateCaster.toDateAdvanced(o, timeZone);
      return new railo.runtime.format.DateFormat(Locale.US).format(date,"dd.mm.yyyy");
    }
View Full Code Here

  @Override
  public long lastModified() {
    PageContext pc = ThreadLocalPageContext.get();
    try{
      DateTime date = Caster.toDate(provider.call(pc,cfc,"lastModified",ZERO_ARGS), true, pc.getTimeZone());
      return date.getTime();
    }
    catch(PageException pe){
      throw new PageRuntimeException(pe);
    }
   
View Full Code Here

    }

    private static YearMonth toYearMonth(Object value) throws PageException {
        if(value instanceof YearMonth) return (YearMonth) value;
        if(Decision.isDateSimple(value,false)) {
            DateTime dt = Caster.toDate(value,null);
            return new YearMonth(dt.getYear(),dt.getMonth());
        }
       
        try {
            return new YearMonth(Caster.toString(value));
        } catch (NumberFormatException nfe) {
View Full Code Here

    }

    private static MonthDay toMonthDay(Object value) throws PageException {
        if(value instanceof MonthDay) return (MonthDay) value;
        if(Decision.isDateSimple(value,false)) {
            DateTime dt = Caster.toDate(value,null);
            return new MonthDay(dt.getMonth(),dt.getDate());
        }
       
        try {
            return new MonthDay(Caster.toString(value));
        } catch (NumberFormatException nfe) {
View Full Code Here

  private int toExpires(String expires) throws ExpressionException {
      String str=StringUtil.toLowerCase(expires.toString());
    if(str.equals("now"))return 0;
    else if(str.equals("never"))return NEVER;
    else {
      DateTime dt = DateCaster.toDateAdvanced(expires,false,null,null);
      if(dt!=null) {
            return toExpires(dt);
        }
        return toExpires(Caster.toIntValue(expires));
    }
View Full Code Here

    }
    public static double call(PageContext pc, Object obj) throws PageException {
      if(obj==null)obj=new DateTimeImpl(pc);
     
      TimeZone tz = ThreadLocalPageContext.getTimeZone(pc);
      DateTime date = DateCaster.toDateAdvanced(obj,tz);
      return format(date);
    }
View Full Code Here

import railo.runtime.op.Caster;
import railo.runtime.type.dt.DateTime;

public final class GetNumericDate implements Function {
  public static double call(PageContext pc , Object object) throws PageException {
        DateTime date = Caster.toDate(object,true,pc.getTimeZone(),null);
        if(date==null) date=Caster.toDate(object,pc.getTimeZone());
       
    return date.toDoubleValue();
  }
View Full Code Here

TOP

Related Classes of railo.runtime.type.dt.DateTime

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.