-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I'm using the following snipped to find the begin and end of several time periods in Joda. The little devil on my left shoulder says thats the way to go... but I dont believe him.
Could anybody with some joda experience take a brief look and tell me that the little guy is right?
(It will be only…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hello,
Let's assume that I have the following table:
CREATE TABLE [dbo].[PricesHist](
[Product] varchar NOT NULL,
[Price] [float] NOT NULL,
[StartDate] [datetime] NOT NULL,
[EndDate] [datetime] NOT NULL
)
INSERT [dbo].[PricesHist] ([Product], [Price], [StartDate], [EndDate]) VALUES (N'Apples'…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
When getting SQL DateTime Resharper suggests to use new DateTime() when value is DBNull.Value. I've always used DateTime.MinValue. Which is the proper way?
DateTime varData = sqlQueryResult["Data"] is DateTime ? (DateTime) sqlQueryResult["Data"] : new DateTime();
>>> More
-
as seen on Dot net Slackers
- Search for 'Dot net Slackers'
This is a simple looking error message that is deceptively hard to track down. Thankfully if you're having this problem then this article should get you back on track without spending hours scratching your head. Scenario It was time to update an existing website so after synchronising my copy of…
>>> More
-
as seen on Geeks with Blogs
- Search for 'Geeks with Blogs'
A client is using Openfire IM for their users, and would like some custom queries to audit user conversations (which are stored by Openfire in tables in the SQL Server database).
Because Openfire supports multiple database servers and multiple platforms, the designers chose to store all date/time…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Basically, i need the equivalent of T-SQL CONVERT(NVARCHAR(10), datevalue, 126)
I've tried:
from t in ctx.table
select t.Date.ToString("yyyy-MM-dd")
but it throws not supported exception
from t in ctx.table
select "" + t.Date.Year + "-" + t.Date.Month + "-" + t.Date.Day
but i don't think it's an…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have been trying to get LastBootUpTime using Win32_OperatingSystem class (WMI).
HRESULT hr = pEnumerator->Next(WBEM_INFINITE, 1,
&pclsObj, &uReturn);
if(0 == uReturn)
{
break;
}
VARIANT vtProp;
// Get the value of the Name property
hr = pclsObj->Get(L"LastBootUpTime"…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I've been doing something along the lines of..
$dt1 = '1000-01-01 00:00:00'; //really some val from db
$dt2 = '1000-01-01 00:00:10'; //another val maybe db maybe formatted
if(strtotime($dt1) > strtotime($dt2){
//do something
}
Is the strtotime needed? can i do a more direct comparison on the…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
MyClass theSession = new MyClass()
{
accountId = 12345,
timeStamp = DateTime.Now,
userType = "theUserType"
};
System.Web.Script.Serialization.JavaScriptSerializer Json = new System.Web.Script.Serialization…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hey all,
I'm working with pbx for voip calls. One aspect of pbx is that you can choose to receive CDR packages. Those packages have 2 timestamps : "utc" and "local", but both seem to always be the same.
Here's an example of a timestamp : "1268927156".
At first sight, there seems to be no logic…
>>> More