[Gambas-user] Time, date & Settings

Benoît Minisini gambas at ...1...
Mon Mar 27 10:41:00 CEST 2017


Le 27/03/2017 à 07:27, PICCORO McKAY Lenz a écrit :
> similar behavior occurs me when i swicht languajes and manipulates amounts
> in my POS system, in english vs spanish decimals alternate with "," and "."
> and theres no way to use an universa only form..
>
> u must stored separated..
>
> Lenz McKAY Gerardo (PICCORO)
> http://qgqlochekone.blogspot.com
>
> 2017-03-26 20:11 GMT-04:00 Jussi Lahtinen <jussi.lahtinen at ...626...>:
>
>> Hi!
>> I'm trying to figure way to handle time & date correctly, ignoring timezone
>> and "daylight saving" adjustments. I can't get things work nicely with
>> settings component as it does not save&load the value in universal format.
>> Example if you write settings in English and open them in Finnish, you will
>> get silent error:
>>
>> Print Settings[sPath &/ "Date&Time", Null]
>> 03/27/2017 12:00:00  <--- this is correct time
>>
>> Print Val(Settings[sPath &/ "Date&Time", Null])
>> This returns nothing, not even error.
>>
>> Print CDate(Settings[sPath &/ "Date&Time", Null])
>> 27.03.2017 09.00.00  <--- this is incorrect time
>>
>> This is from the GAlarm project and I want to ignore timezones etc, because
>> I want the alarms go off accordingly to the computer clock. IE alarm set to
>> go off at 12:00 should go off, if computer clock shows 12:00. Not at 09:00,
>> because I cannot know what timezone the user meant, so I always assume
>> local.
>>
>>
>> Do I have to write seconds, minutes, hours, etc separately in the settings
>> or could this be fixed somehow..?
>>
>>
>>
>> Jussi

Using the development version, you have to store your date in the 
settings file using CStr(), and read it using CDate().

Regards,

-- 
Benoît Minisini




More information about the User mailing list