Using SQL Server 2008 and SQL Server 2005 and date time

A quick google points me to what looks like the solution. Open your EDMX in a file editor (or “open with…” in Visual Studio and select XML Editor). At the top you will find the storage model and it has an attribute ProviderManifestToken. This has should have the value 2008. Change that to 2005, recompile … Read more

How to add number of days in postgresql datetime

This will give you the deadline : select id, title, created_at + interval ‘1’ day * claim_window as deadline from projects Alternatively the function make_interval can be used: select id, title, created_at + make_interval(days => claim_window) as deadline from projects To get all projects where the deadline is over, use: select * from ( select … Read more

Converting dd/mm/yyyy formatted string to Datetime [duplicate]

You need to use DateTime.ParseExact with format “dd/MM/yyyy” DateTime dt=DateTime.ParseExact(“24/01/2013”, “dd/MM/yyyy”, CultureInfo.InvariantCulture); Its safer if you use d/M/yyyy for the format, since that will handle both single digit and double digits day/month. But that really depends if you are expecting single/double digit values. Your date format day/Month/Year might be an acceptable date format for some … Read more

Best way to compare dates in Android

Your code could be reduced to SimpleDateFormat sdf = new SimpleDateFormat(“dd/MM/yyyy”); Date strDate = sdf.parse(valid_until); if (new Date().after(strDate)) { catalog_outdated = 1; } or SimpleDateFormat sdf = new SimpleDateFormat(“dd/MM/yyyy”); Date strDate = sdf.parse(valid_until); if (System.currentTimeMillis() > strDate.getTime()) { catalog_outdated = 1; }