Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > OOP
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #6  
Antiguo 29-07-2011
Avatar de Chris
[Chris] Chris is offline
Miembro Premium
 
Registrado: abr 2007
Ubicación: Jinotepe, Nicaragua
Posts: 1.678
Poder: 21
Chris Va por buen camino
Cita:
Empezado por jlrdz Ver Mensaje
De hecho me interesa recuperarlo como entero para saber si hay una diferencia menor a 10 minutos pero la verdad soy nuevo en esto y estaba investigando pero me he confundido más :s. Saludos!.
Talvez solamente necesitas esto:
Código Delphi [-]
if MinuteSpan(tiempo1,tiempo2) > 10 then
begin
    // ....
end;

Saludos,
Chris

PD.: Ten cuidado con la función StrToDateTime. Según la ayuda de Delphi:

Cita:
Empezado por Ayuda de Delphi
Converts a string to a TDateTime value.

Pascal
function StrToDateTime(const S: string): TDateTime; overload;
function StrToDateTime(const S: string; const FormatSettings: TFormatSettings): TDateTime; overload;

File
SysUtils

Description
Call StrToDateTime to parse a string that specifies a date and time value. If S does not contain a valid date, StrToDateTime raises an EConvertError exception.

The S parameter must use the current locale's date/time format. In the US, this is commonly MM/DD/YY HH:MM:SS format. Specifying AM or PM as part of the time is optional, as are the seconds. Use 24-hour time (7:45 PM is entered as 19:45, for example) if AM or PM is not specified.

Year values between 0 and 99 are converted using the TwoDigitYearCenturyWindow. This value is stored either in a global variable (first form) or as a field in the FormatSettings parameter (second form) See "Currency and Date-Time Formatting Variables" for more information.

The first form of StrToDateTime is not thread-safe, because it uses localization information contained in global variables. The second form of StrToDateTime, which is thread-safe, refers to localization information contained in the FormatSettings parameter. Before calling the thread-safe form of StrToDateTime, you must populate FormatSettings with localization information. To populate FormatSettings with a set of default locale values, call GetLocaleFormatSettings.
__________________
Perfil Github - @chrramirez - Delphi Blog - Blog Web
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
calculo de diferencia entre dos horas y minutos gonza_619 Varios 1 22-05-2010 20:35:31
Diferencia 2 Dias entre Tdatetime (delphi) y Datetime (SQL server) sinalocarlos Varios 2 10-05-2007 03:00:38
Numero de dias entre fechas (TDateTime) sierraja Varios 4 26-04-2005 18:29:02
minutos entre dos fechas jmlifi Firebird e Interbase 3 15-04-2005 12:39:36


La franja horaria es GMT +2. Ahora son las 11:33:39.


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
Copyright 1996-2007 Club Delphi