Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Firebird e Interbase (https://www.clubdelphi.com/foros/forumdisplay.php?f=19)
-   -   Firebird's "Sliding Century Window" (https://www.clubdelphi.com/foros/showthread.php?t=73816)

gluglu 18-05-2011 13:21:44

Firebird's "Sliding Century Window"
 
Cita:

Firebird's "Sliding Century Window"

To deduce the century, Firebird uses a sliding window algorithm. Its effect is to interpret a two-digit year value as the nearest year to the current year, in a range spanning the preceding 50 years and the succeeding 50 years.
Existe alguna manera de modificar este parámetro para que a la hora de introducir el año con 2 cifras en un campo de fecha, me tome el valor que realmente yo quiera.

Al día de hoy, si se introduce por ejemplo una fecha de nacimiento del 1965, con dos cifras, es decir, 65 en el campo de fecha (incluso en el IBExpert), me toma correctamente el año 1965. Pero si introduzco 59 (con dos cifras), automáticamente se convierten en 2065.

Está claro que en un proceso de validación se puede comprobar si la fecha es correcta y tiene sentido o no.

Mi pregunta más bien se dirige a si esa 'ventana' en el algoritmo de Firebird, es objeto de posible modificación o no.

:confused:

gluglu 18-05-2011 13:49:59

Ya lo encontré !

Cita:

SysUtils.TwoDigitYearCenturyWindow Variable

Determines what century is added to two-digit years when string dates are converted to numeric dates.

The value of TwoDigitYearCenturyWindow, if it is nonzero, is subtracted from the current year to calculate the floating "pivot" prior to which two-digit years are interpreted as falling in the next century. The default value is 50. The table below shows some examples.
;) ;)

Casimiro Noteví 18-05-2011 14:00:24

Yo me lo guiso, yo me lo como. ¡¡¡No has dado tiempo a contestar!!! :D


La franja horaria es GMT +2. Ahora son las 04:51:20.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi