Fix calcolo datetime invariante su lingua...
This commit is contained in:
@@ -4,6 +4,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Globalization;
|
||||
using System.Web;
|
||||
|
||||
namespace SteamWare
|
||||
@@ -229,8 +230,15 @@ namespace SteamWare
|
||||
{
|
||||
// se è in cache
|
||||
if (isInCacheObject("lastUpdateAppConf"))
|
||||
{
|
||||
answ = Convert.ToDateTime(objCacheObj("lastUpdateAppConf"));
|
||||
{
|
||||
// faccio SEMPRE calcolo esatto sennò sbaglia...
|
||||
CultureInfo provider = CultureInfo.InvariantCulture;
|
||||
string format = "yyyy-MM-dd HH:mm:ss";
|
||||
answ = DateTime.ParseExact(objCacheObj("lastUpdateAppConf").ToString(), format, provider);
|
||||
#if false
|
||||
// mi aspetto formato standard...
|
||||
answ = Convert.ToDateTime(objCacheObj("lastUpdateAppConf"));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
@@ -241,7 +249,12 @@ namespace SteamWare
|
||||
}
|
||||
set
|
||||
{
|
||||
setCacheVal("lastUpdateAppConf", value, true);
|
||||
// faccio SEMPRE calcolo esatto sennò sbaglia...
|
||||
CultureInfo provider = CultureInfo.InvariantCulture;
|
||||
string format = "yyyy-MM-dd HH:mm:ss";
|
||||
string valore = value.ToString(format, provider);
|
||||
// ora salvo!
|
||||
setCacheVal("lastUpdateAppConf", valore, true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1179,7 +1192,7 @@ namespace SteamWare
|
||||
answ = redVal != null && redVal != "";
|
||||
}
|
||||
}
|
||||
catch(Exception exc)
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in verifica isInCacheObject REDIS per chiave{0}{1}{2}", nomeVar, Environment.NewLine, exc));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user