Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.basic.visual.misc > #1255

Re: converting a date to a date but without the time element

From "Theo Tress" <rbk@online.de>
Newsgroups comp.lang.basic.visual.misc
Subject Re: converting a date to a date but without the time element
Date 2012-07-07 12:13 +0200
Organization 1&1 Internet AG
Message-ID <jt9250$mp5$1@online.de> (permalink)
References <cfcf1a84-9f99-4937-806e-4a745121e4fb@b21g2000yqn.googlegroups.com>

Show all headers | View raw


> My issue is that I want to compare this date with that of other dates
> but at the moment they arent being evaluated as equal because of the
> hours and minutes difference.

try  this:

Dim D as Double
Dim L as Long
D = Now 'or any other date
L = CLng(Fix(D))
Debug.Print D, L


Fix() will truncate (and not round up) the hh:nn:ss part, and can handle 
long integers, so you can easily compare two dates:

Dim SameDay as Boolean
SameDay = CLng(Fix(D1)) = CLng(Fix(D2))  'true if D1 refers to same day as 
D2 

Back to comp.lang.basic.visual.misc | Previous | NextPrevious in thread | Find similar


Thread

converting a date to a date but without the time element colmkav <colmjkav@yahoo.co.uk> - 2012-06-07 02:07 -0700
  Re: converting a date to a date but without the time element Deanna Earley <dee.earley@icode.co.uk> - 2012-06-07 10:26 +0100
    Re: converting a date to a date but without the time element colmkav <colmjkav@yahoo.co.uk> - 2012-06-07 03:29 -0700
      Re: converting a date to a date but without the time element Deanna Earley <dee.earley@icode.co.uk> - 2012-06-07 11:43 +0100
        Re: converting a date to a date but without the time element colmkav <colmjkav@yahoo.co.uk> - 2012-06-07 04:50 -0700
          Re: converting a date to a date but without the time element Karl E. Peterson <karl@exmvps.org> - 2012-06-07 11:50 -0700
      Re: converting a date to a date but without the time element Helmut_Meukel <Helmut_Meukel@bn-hof.invalid> - 2012-06-26 09:57 +0200
  Re: converting a date to a date but without the time element Barry Etheridge <purple.mug@googlemail.com> - 2012-06-07 07:49 -0700
    Re: converting a date to a date but without the time element Deanna Earley <dee.earley@icode.co.uk> - 2012-06-07 15:54 +0100
    Re: converting a date to a date but without the time element "DaveO" <djo@dial.pipex.com> - 2012-06-07 16:00 +0100
  Re: converting a date to a date but without the time element ReverendFuzzy <google@msbministries.org> - 2012-07-05 08:51 -0700
  Re: converting a date to a date but without the time element ReverendFuzzy <google@msbministries.org> - 2012-07-05 08:54 -0700
  Re: converting a date to a date but without the time element "Theo Tress" <rbk@online.de> - 2012-07-07 12:13 +0200

csiph-web