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

Path csiph.com!usenet.pasdenom.info!gegeweb.42!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!news.cgarbs.de!news.addix.net!feed.news.schlund.de!schlund.de!news.online.de!not-for-mail
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 Sat, 7 Jul 2012 12:13:10 +0200
Organization 1&1 Internet AG
Lines 20
Message-ID <jt9250$mp5$1@online.de> (permalink)
References <cfcf1a84-9f99-4937-806e-4a745121e4fb@b21g2000yqn.googlegroups.com>
NNTP-Posting-Host dslb-094-217-088-136.pools.arcor-ip.net
Mime-Version 1.0
Content-Type text/plain; format=flowed; charset="iso-8859-1"; reply-type=original
Content-Transfer-Encoding 7bit
X-Trace online.de 1341656032 23333 94.217.88.136 (7 Jul 2012 10:13:52 GMT)
X-Complaints-To abuse@einsundeins.com
NNTP-Posting-Date Sat, 7 Jul 2012 10:13:52 +0000 (UTC)
In-Reply-To <cfcf1a84-9f99-4937-806e-4a745121e4fb@b21g2000yqn.googlegroups.com>
X-Priority 3
X-MSMail-Priority Normal
X-Newsreader Microsoft Windows Mail 6.0.6002.18197
X-MimeOLE Produced By Microsoft MimeOLE V6.0.6002.18463
Xref csiph.com comp.lang.basic.visual.misc:1255

Show key headers only | 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