<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="es">
	<id>https://techshareroom.com/techshareroom_wiki/index.php?action=history&amp;feed=atom&amp;title=M%C3%B3dulo%3AFecha</id>
	<title>Módulo:Fecha - Historial de revisiones</title>
	<link rel="self" type="application/atom+xml" href="https://techshareroom.com/techshareroom_wiki/index.php?action=history&amp;feed=atom&amp;title=M%C3%B3dulo%3AFecha"/>
	<link rel="alternate" type="text/html" href="https://techshareroom.com/techshareroom_wiki/index.php?title=M%C3%B3dulo:Fecha&amp;action=history"/>
	<updated>2026-05-17T00:48:15Z</updated>
	<subtitle>Historial de revisiones de esta página en la wiki</subtitle>
	<generator>MediaWiki 1.47.0-alpha</generator>
	<entry>
		<id>https://techshareroom.com/techshareroom_wiki/index.php?title=M%C3%B3dulo:Fecha&amp;diff=522&amp;oldid=prev</id>
		<title>Adgellida: 1 revisión importada</title>
		<link rel="alternate" type="text/html" href="https://techshareroom.com/techshareroom_wiki/index.php?title=M%C3%B3dulo:Fecha&amp;diff=522&amp;oldid=prev"/>
		<updated>2021-08-25T20:59:39Z</updated>

		<summary type="html">&lt;p&gt;1 revisión importada&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;es&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Revisión anterior&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revisión del 22:59 25 ago 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;es&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(Sin diferencias)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Adgellida</name></author>
	</entry>
	<entry>
		<id>https://techshareroom.com/techshareroom_wiki/index.php?title=M%C3%B3dulo:Fecha&amp;diff=521&amp;oldid=prev</id>
		<title>Plantilla&gt;Juan Mayordomo en 17:59 26 mar 2017</title>
		<link rel="alternate" type="text/html" href="https://techshareroom.com/techshareroom_wiki/index.php?title=M%C3%B3dulo:Fecha&amp;diff=521&amp;oldid=prev"/>
		<updated>2017-03-26T17:59:21Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Página nueva&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local z = {}&lt;br /&gt;
&lt;br /&gt;
local meses = {&lt;br /&gt;
       &amp;#039;enero&amp;#039;,&amp;#039;febrero&amp;#039;,&amp;#039;marzo&amp;#039;,&amp;#039;abril&amp;#039;,&amp;#039;mayo&amp;#039;,&amp;#039;junio&amp;#039;,&amp;#039;julio&amp;#039;,&amp;#039;agosto&amp;#039;,&amp;#039;septiembre&amp;#039;,&amp;#039;octubre&amp;#039;,&amp;#039;noviembre&amp;#039;,&amp;#039;diciembre&amp;#039;}&lt;br /&gt;
&lt;br /&gt;
function z.fechaActual()&lt;br /&gt;
	local d = os.date(&amp;#039;!*t&amp;#039;)&lt;br /&gt;
	&lt;br /&gt;
	local fecha = {}&lt;br /&gt;
	fecha.anyo    = d.year&lt;br /&gt;
	fecha.mes     = d.month&lt;br /&gt;
	fecha.dia     = d.day&lt;br /&gt;
	fecha.hora    = d.hour&lt;br /&gt;
	fecha.minuto  = d.min&lt;br /&gt;
	fecha.segundo = d.sec&lt;br /&gt;
		&lt;br /&gt;
	return fecha&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function validar(fecha)&lt;br /&gt;
	fecha.anyo    = tonumber(fecha.anyo)&lt;br /&gt;
	fecha.mes     = tonumber(fecha.mes)&lt;br /&gt;
	fecha.dia     = tonumber(fecha.dia)&lt;br /&gt;
	fecha.hora    = tonumber(fecha.hora)&lt;br /&gt;
	fecha.minuto  = tonumber(fecha.minuto)&lt;br /&gt;
	fecha.segundo = tonumber(fecha.segundo)&lt;br /&gt;
	&lt;br /&gt;
	-- Falta validar que es una fecha válida&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function z.edad(fecha1, fecha2)&lt;br /&gt;
	--Función que devuelve la edad en años entre dos fechas&lt;br /&gt;
	&lt;br /&gt;
	--Se supone que las fechas se han validado previamente.&lt;br /&gt;
	&lt;br /&gt;
	if not fecha1 then&lt;br /&gt;
		return -- falta devolver un error&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if not fecha2 then&lt;br /&gt;
		fecha2=z.fechaActual()&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local anyos = fecha2.anyo - fecha1.anyo&lt;br /&gt;
	&lt;br /&gt;
	--if true then return require(&amp;#039;Módulo:Tablas&amp;#039;).tostring(fecha2) end&lt;br /&gt;
	&lt;br /&gt;
	if fecha2.mes &amp;lt; fecha1.mes or&lt;br /&gt;
	   (fecha2.mes == fecha1.mes and fecha2.dia &amp;lt; fecha1.dia) then&lt;br /&gt;
	   	anyos = anyos - 1&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if anyos &amp;lt; 0 then&lt;br /&gt;
		return -- falta devolver error&lt;br /&gt;
	elseif anyos == 0 then&lt;br /&gt;
		return &amp;#039;menos de un año&amp;#039;&lt;br /&gt;
	elseif anyos == 1 then&lt;br /&gt;
		return &amp;#039;un año&amp;#039;&lt;br /&gt;
	else&lt;br /&gt;
		return anyos .. &amp;#039; años&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function z.llamadaDesdeUnaPlantilla(frame)&lt;br /&gt;
	function obtenerFecha(dia, mes, anyo)&lt;br /&gt;
		local resultado={}&lt;br /&gt;
	&lt;br /&gt;
		if dia then&lt;br /&gt;
			resultado.dia  = dia&lt;br /&gt;
			resultado.mes  = mes&lt;br /&gt;
			resultado.anyo = anyo&lt;br /&gt;
			&lt;br /&gt;
			validar(resultado)&lt;br /&gt;
			&lt;br /&gt;
			return resultado&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local args = frame.args&lt;br /&gt;
	&lt;br /&gt;
	local funcion = z[args[1]]&lt;br /&gt;
	local fecha1  = obtenerFecha(args[2], args[3], args[4])&lt;br /&gt;
	local fecha2  = obtenerFecha(args[5], args[6], args[7])&lt;br /&gt;
&lt;br /&gt;
	return funcion(fecha1, fecha2)&lt;br /&gt;
end&lt;br /&gt;
       &lt;br /&gt;
return z&lt;/div&gt;</summary>
		<author><name>Plantilla&gt;Juan Mayordomo</name></author>
	</entry>
</feed>