gpt4 book ai didi

org.eigenbase.util14.ZonelessDatetime.setZonelessTime()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 19:12:31 29 4
gpt4 key购买 nike

本文整理了Java中org.eigenbase.util14.ZonelessDatetime.setZonelessTime()方法的一些代码示例,展示了ZonelessDatetime.setZonelessTime()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZonelessDatetime.setZonelessTime()方法的具体详情如下:
包路径:org.eigenbase.util14.ZonelessDatetime
类名称:ZonelessDatetime
方法名:setZonelessTime

ZonelessDatetime.setZonelessTime介绍

暂无

代码示例

代码示例来源:origin: org.apache.optiq/optiq-core

private static void printDatetime(
  PrintWriter pw,
  ZonelessDatetime datetime,
  Comparable value) {
 assert value instanceof Calendar;
 datetime.setZonelessTime(
   ((Calendar) value).getTimeInMillis());
 pw.print(datetime);
}

代码示例来源:origin: net.hydromatic/optiq

private static void printDatetime(
  PrintWriter pw,
  ZonelessDatetime datetime,
  Comparable value)
{
  assert (value instanceof Calendar);
  datetime.setZonelessTime(
    ((Calendar) value).getTimeInMillis());
  pw.print(datetime);
}

代码示例来源:origin: net.hydromatic/optiq

public void setZonelessTime(long value)
{
  super.setZonelessTime(value);
  clearTime();
}

代码示例来源:origin: net.hydromatic/optiq

public void setZonelessTime(long value)
{
  super.setZonelessTime(value);
  clearDate();
}

代码示例来源:origin: org.apache.optiq/optiq-core

public void setZonelessTime(long value) {
 super.setZonelessTime(value);
 clearDate();
}

代码示例来源:origin: org.apache.optiq/optiq-core

public void setZonelessTime(long value) {
 super.setZonelessTime(value);
 clearTime();
}

代码示例来源:origin: cascading/lingual-core

@Override
public Object coerce( Object value, Type to )
 {
 if( value == null )
  return null;
 Class from = value.getClass();
 if( from != Long.class )
  throw new IllegalStateException( "was not normalized" );
 // TIMESTAMP has no timezone precision so set this for the current timezone
 long timezoneOffset =  TimeZone.getDefault().getOffset( (Long) value );
 value = ( (Long) value ) + timezoneOffset;
 // no coercion, or already in canonical form
 if( to == Long.class || to == long.class || to == Object.class )
  return value;
 if( to == Integer.class )
  return ( (Long) value ).intValue();
 ZonelessDatetime date = createInstance();
 date.setZonelessTime( (Long) value );
 if( to == String.class )
  return date.toString();
 if( to == java.sql.Date.class )
  return new java.sql.Date( date.getJdbcDate( DateTimeUtil.defaultZone ) );
 if( to == java.sql.Timestamp.class )
  return new java.sql.Timestamp( date.getJdbcTimestamp( DateTimeUtil.defaultZone ) );
 if( to == java.sql.Time.class )
  return new java.sql.Time( date.getJdbcTime( DateTimeUtil.defaultZone ) );
 throw new CascadingException( "unknown type coercion requested, from: " + Util.getTypeName( from ) + " to: " + Util.getTypeName( to ) );
 }

代码示例来源:origin: cascading/lingual-core

@Override
public Object coerce( Object value, Type to )
 {
 if( value == null )
  return null;
 Class from = value.getClass();
 if( from != Integer.class )
  throw new IllegalStateException( "was not normalized" );
 // no coercion, or already in canonical form
 if( to == Integer.class || to == int.class || to == Object.class )
  return value;
 if( to == Long.class )
  return ( (Integer) value ).intValue();
 ZonelessDatetime date = createInstance();
 date.setZonelessTime( (Integer) value % MILLIS_PER_DAY );
 if( to == String.class )
  return date.toString();
 if( to == java.sql.Date.class )
  return new java.sql.Date( date.getJdbcDate( DateTimeUtil.defaultZone ) );
 if( to == java.sql.Timestamp.class )
  return new java.sql.Timestamp( date.getJdbcTimestamp( DateTimeUtil.defaultZone ) );
 if( to == java.sql.Time.class )
  return new java.sql.Time( date.getJdbcTime( DateTimeUtil.defaultZone ) );
 throw new CascadingException( "unknown type coercion requested, from: " + Util.getTypeName( from ) + " to: " + Util.getTypeName( to ) );
 }
}

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com