Dear visitor, welcome to Jabaco - Community.
If this is your first visit here, please read the Help. It explains in detail how this page works.
To use all features of this page, you should consider registering.
Please use the registration form, to register here or read more information about the registration process.
If you are already registered, please login here.
Now function
Searching for "now" on forums yielded too much obsolete stuff....
How can I call the equivelant of Now() ?
Wºz™
where do you want to appear it?
Label, textbox? what ?
for example if you have a label "test" then...
test.Caption = now
This post has been edited 1 times, last edit by "fomaxrge" (Oct 12th 2012, 4:37pm)
|
Jabaco Source
|
1
2
|
Dim Dob As String = InputBox("Please enter the Date Of Birth:", "DOB")
age = DateDiff("d",Dob,now) msgbox age
|
...does nothing so i tried....
|
Jabaco Source
|
1
2
|
Dim Dob As String = InputBox("Please enter the Date Of Birth:", "DOB")Dim todate as datetodate = now()
age = DateDiff("d",Dob,todate)msgbox age
|
...also tried....
|
Jabaco Source
|
1
2
|
Dim Dob As String = InputBox("Please enter the Date Of Birth:", "DOB")Dim todate as now()
age = DateDiff("d",Dob,todate) msgbox age
|
....nothing is returned...no msgbox..nada
...stupid forum seems to wrap my code....its setout correctly.
Hey there,
from my experiance with Jabaco the Format and Date -related functions don't allways work as expected!
So you might be better off doing some dirty stringmanipulations.
Just do get this working look at this
|
Jabaco Source
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
Option Explicit
Public Sub Form_Load()
Dim Dob As String = InputBox("Please enter the Date Of Birth:", "DOB")
'2012/10/01
'expected inputformat for DateDiff -> dd.MM.yyyy
MsgBox DateDiff("d", MyDate(Dob), MyDate(Now))
End Sub
Public Function MyDate(d As String) As Date
'Input -> yyyy/mm/dd
'Output -> dd.mm.yyyy
Dim sdt() As String
Dim sd() As String
sdt = Split(d," ")
sd = Split(sdt(0),"/")
MyDate = CDate(sd(2) & "." & sd(1) & "." & sd(0))
' If UBound(sdt)> 0 Then MyDate = MyDate & " " & sdt(1)
End Function
'https://code.google.com/searchframe#pOD0Tthq4jU/trunk/Framework/src/VBA/DateTime.java&q=DateDiff%20package:jabacoframework%5C.googlecode%5C.com
'
|
Dani
This post has been edited 1 times, last edit by "Dani" (Oct 13th 2012, 11:01am)