草庐IT

DATETIME

全部标签

c# - Sqlite - 插入给出错误 - 无效的转换异常 - "Invalid cast from ' DateTime' 到 'Int32'。”

varidParam=newSQLiteParameter("@idParam",SqlDbType.Text){Value=insertData.ID};varuserIdParam=newSQLiteParameter("@userIdParam",SqlDbType.VarChar){Value=insertData.Uid};varapplicationNameParam=newSQLiteParameter("@applicationNameParam",SqlDbType.VarChar){Value=insertData.Application};vareventName

c# - Sqlite - 插入给出错误 - 无效的转换异常 - "Invalid cast from ' DateTime' 到 'Int32'。”

varidParam=newSQLiteParameter("@idParam",SqlDbType.Text){Value=insertData.ID};varuserIdParam=newSQLiteParameter("@userIdParam",SqlDbType.VarChar){Value=insertData.Uid};varapplicationNameParam=newSQLiteParameter("@applicationNameParam",SqlDbType.VarChar){Value=insertData.Application};vareventName

python - SQLAlchemy 使用 SQLite 丢失时区信息

我遇到一个问题,当SQLAlchemy(版本0.6.4和0.6.8)提交到SQLite数据库时,datetime对象丢失了时区信息,其中的列用SQLAlchemy的日期时间类。(我意识到SQLAlchemy正在将其转换为字符串并返回,我认为这是问题的一半)。由于代码胜于Eloquent,我有以下示例/复制器:importdatetime,pytz,sqlalchemyfromsqlalchemyimportcreate_engine,Column,Integer,DateTimefromsqlalchemy.ext.declarativeimportdeclarative_basefr

python - SQLAlchemy 使用 SQLite 丢失时区信息

我遇到一个问题,当SQLAlchemy(版本0.6.4和0.6.8)提交到SQLite数据库时,datetime对象丢失了时区信息,其中的列用SQLAlchemy的日期时间类。(我意识到SQLAlchemy正在将其转换为字符串并返回,我认为这是问题的一半)。由于代码胜于Eloquent,我有以下示例/复制器:importdatetime,pytz,sqlalchemyfromsqlalchemyimportcreate_engine,Column,Integer,DateTimefromsqlalchemy.ext.declarativeimportdeclarative_basefr

结合 GROUP BY 和 SUM 的 SQL

我需要SQL方面的帮助。我有一个像这样的sqlite表;CREATETABLEmytable(datetimeDATE,typeTEXT,amountREAL)我需要一个查询来汇总每种类型和年月的金额(正如您所看到的,由于数据可以跨越数年,因此也提取了年份)。我已经完成了一些事情,但我对SQL有点生疏。sqlite>SELECTstrftime('%Y',datetime)ASyear,strftime('%m',datetime)ASmonth,type,amountFROMmytable;2009|06|Type1|-1000.02009|06|Type1|-100.02009|0

结合 GROUP BY 和 SUM 的 SQL

我需要SQL方面的帮助。我有一个像这样的sqlite表;CREATETABLEmytable(datetimeDATE,typeTEXT,amountREAL)我需要一个查询来汇总每种类型和年月的金额(正如您所看到的,由于数据可以跨越数年,因此也提取了年份)。我已经完成了一些事情,但我对SQL有点生疏。sqlite>SELECTstrftime('%Y',datetime)ASyear,strftime('%m',datetime)ASmonth,type,amountFROMmytable;2009|06|Type1|-1000.02009|06|Type1|-100.02009|0

c# - 在执行 ISQLQuery.UniqueResult<DateTime>() 时,如何让 SQLite 返回正确的 DateTime?

TLDR:Thefollowingcodeisruninthedifferentdatabases,Oracle:selectsysdatefromdualSQLiteselectdatetime('now')WhendoingSession.CreateSQLQuery(cmd).UniqueResult()theresultisaDateTimewhenworkingagainstOraclebutastringwhenworkingagainstSQLite.ItfeelslikeabugintheSQLitedriverandahacktocheckthereturnedtyp

c# - 在执行 ISQLQuery.UniqueResult<DateTime>() 时,如何让 SQLite 返回正确的 DateTime?

TLDR:Thefollowingcodeisruninthedifferentdatabases,Oracle:selectsysdatefromdualSQLiteselectdatetime('now')WhendoingSession.CreateSQLQuery(cmd).UniqueResult()theresultisaDateTimewhenworkingagainstOraclebutastringwhenworkingagainstSQLite.ItfeelslikeabugintheSQLitedriverandahacktocheckthereturnedtyp

c# - 通过 (Fluent)NHibernate 添加到 SQLite DB 时 DateTime 不正确

我有一个要存储到SQLite数据库的组件。publicclassComp:Entity{publicvirtualDateTimeTimeStamp{get;set;}publicvirtualStringName{get;set;}}publicclassCompMap:ClassMap{publicCompMap(){Id(x=>x.Id);Map(x=>x.TimeStamp);Map(x=>x.Name);}}真的没什么特别的。问题是TimeStamp未正确存储在数据库中(SQLite-Explorer显示值“30-12-1899”)我认为这与nHibernate将DateTi

c# - 通过 (Fluent)NHibernate 添加到 SQLite DB 时 DateTime 不正确

我有一个要存储到SQLite数据库的组件。publicclassComp:Entity{publicvirtualDateTimeTimeStamp{get;set;}publicvirtualStringName{get;set;}}publicclassCompMap:ClassMap{publicCompMap(){Id(x=>x.Id);Map(x=>x.TimeStamp);Map(x=>x.Name);}}真的没什么特别的。问题是TimeStamp未正确存储在数据库中(SQLite-Explorer显示值“30-12-1899”)我认为这与nHibernate将DateTi