#Iniciante

2 Seguidores · 33 Postagens

A tag de iniciante reúne artigos e perguntas para aqueles que estão começando com a InterSystems Data Platform

Novo
Artigo Evandro Wendt · Mar. 5 1m read

Olá a todos,

Criei um método para calcular a idade de uma pessoa, ou a idade de um processo, contrato ou qualquer outra coisa que você quiser.

/// Calculate the age from date of birth and other date (by default shoud be today).
/// <b>dateOfBird</b> Date of birth in cache format. ie. $ZDH("1972-01-01",3)
/// <b>day</b> Date to calculate to. ie: $H
ClassMethod AgeAt(dateOfBirth, day) As %Integer{
    quit:dateOfBirth=""
    quit:day=""
    
    set yeardob=$SYSTEM.SQL.DATEPART("year",dateOfBirth)
    set yearday=$SYSTEM.SQL.
0
0 4