cambio fix lunghezza stringa dataora x processing...
This commit is contained in:
Binary file not shown.
+3
-18
@@ -418,6 +418,7 @@ namespace MapoDb
|
||||
Int64 delta = 0;
|
||||
try
|
||||
{
|
||||
// se ho meno decimali x evento rispetto dtCorrente...
|
||||
if (dtEve.Length < dtCurr.Length)
|
||||
{
|
||||
dtEve = dtEve.PadRight(dtCurr.Length, '0');
|
||||
@@ -432,25 +433,9 @@ namespace MapoDb
|
||||
{
|
||||
// in questo caso elimino i MS dalle stringhe e converto i datetime....
|
||||
CultureInfo provider = CultureInfo.InvariantCulture;
|
||||
string formatShort = "yyyyMMddHHmmss";
|
||||
string format = "yyyyMMddHHmmssfff";
|
||||
// SE ho solo fino ai secondi uso formatShort...
|
||||
if (dtEve.Length > 14)
|
||||
{
|
||||
dtEvento = DateTime.ParseExact(dtEve, format, provider);
|
||||
}
|
||||
else
|
||||
{
|
||||
dtEvento = DateTime.ParseExact(dtEve, formatShort, provider);
|
||||
}
|
||||
if (dtCurr.Length > 14)
|
||||
{
|
||||
dtCorrente = DateTime.ParseExact(dtCurr, format, provider);
|
||||
}
|
||||
else
|
||||
{
|
||||
dtCorrente = DateTime.ParseExact(dtCurr, formatShort, provider);
|
||||
}
|
||||
dtEvento = DateTime.ParseExact(dtEve, format, provider);
|
||||
dtCorrente = DateTime.ParseExact(dtCurr, format, provider);
|
||||
Int64 tiks = dtCorrente.Ticks - dtEvento.Ticks;
|
||||
dataOraEvento = dataOraEvento.AddTicks(-tiks);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user