001    package railo.runtime.functions.dateTime;
002    
003    import java.util.TimeZone;
004    
005    import railo.runtime.PageContext;
006    import railo.runtime.exp.ExpressionException;
007    import railo.runtime.ext.function.Function;
008    import railo.runtime.tag.util.DeprecatedUtil;
009    import railo.runtime.type.dt.DateTime;
010    import railo.runtime.type.dt.DateTimeImpl;
011    
012    /**
013     * Implements the Cold Fusion Function now
014     * @deprecated removed with no replacement
015     */
016    public final class NowServer implements Function {
017            /**
018             * @param pc
019             * @return server time
020             * @throws ExpressionException 
021             */
022            public static DateTime call(PageContext pc ) throws ExpressionException {
023                    DeprecatedUtil.function(pc,"nowServer");
024                    long now = System.currentTimeMillis();
025                    int railo = pc.getTimeZone().getOffset(now);
026                    int server = TimeZone.getDefault().getOffset(now);
027                    
028                    return new DateTimeImpl(pc,now-(railo-server),false);
029                    
030            }
031            
032    }