Example #1
0
    static int ConvertDateTimeInt(IntPtr L)
    {
        try
        {
            ToLua.CheckArgsCount(L, 1);
            System.DateTime arg0 = StackTraits <System.DateTime> .Check(L, 1);

            double o = TimeConverter.ConvertDateTimeInt(arg0);
            LuaDLL.lua_pushnumber(L, o);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Example #2
0
    private static int ConvertDateTimeInt(IntPtr L)
    {
        int result;

        try
        {
            ToLua.CheckArgsCount(L, 1);
            DateTime time   = (DateTime)ToLua.CheckObject(L, 1, typeof(DateTime));
            double   number = TimeConverter.ConvertDateTimeInt(time);
            LuaDLL.lua_pushnumber(L, number);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaDLL.toluaL_exception(L, e, null);
        }
        return(result);
    }