473,383 Members | 1,822 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Setting System Time and Date from VB6.0

vdraceil
236 100+
Hi experts, I have a question. Is it possible to set (change/edit) the system time and date by coding in vb6.0? I think it's not possible (80%) but maybe experts might have an answer - I suppose.
Dec 16 '07 #1
12 31809
daniel aristidou
491 256MB
Hi experts, I have a question. Is it possible to set (change/edit) the system time and date by coding in vb6.0? I think it's not possible (80%) but maybe experts might have an answer - I suppose.
I could not find a way from vb 6 however there is a way using vb 2005.
Visual Basic 2005
Visual Basic 2005 replaces Date and Time with the Today and TimeOfDay properties, which use the eight-byte common language runtime (CLR) DateTime structure. This corresponds with the Date data type in Visual Basic 2005. You can use Today and TimeOfDay to both set and fetch the system date and time.

Visual Basic 2005 replaces the Date$ and Time$ functions with the DateString and TimeString properties. You can use DateString and TimeString to both set and fetch the system date and time.

The Now and Timer functions are replaced by read-only properties of the same names. Their calling sequences remain unchanged.

Merry Christmas
Dec 25 '07 #2
QVeen72
1,445 Expert 1GB
Hi experts, I have a question. Is it possible to set (change/edit) the system time and date by coding in vb6.0? I think it's not possible (80%) but maybe experts might have an answer - I suppose.

Hi,

Date = CDate("29-12-2007")

Regards
Veena
Dec 25 '07 #3
Torgg
41
If memory serves, Windows XP (SP2) and Vista systems update their date and time from the internet every few days.
Dec 26 '07 #4
Killer42
8,435 Expert 8TB
If memory serves, Windows XP (SP2) and Vista systems update their date and time from the internet every few days.
Only if you configure them that way.

In fact, I don't think XP has that built in at all, does it? Don't you have to download synchronisation software from somewhere? Or am I think of an earlier version of Windows?
Dec 29 '07 #5
vdraceil
236 100+
Hi,

Date = CDate("29-12-2007")

Regards
Veena
Thanks for replying..
Isn't CDate() a conversion type function like CInt,CSng etc..Will it set system time?! Please clear my doubt..
Dec 31 '07 #6
Killer42
8,435 Expert 8TB
Thanks for replying..
Isn't CDate() a conversion type function like CInt,CSng etc..Will it set system time?! Please clear my doubt..
That's right. The CDate function in that code was simply converting the string to a date value.

I have no idea whether it works or not, but assigning the value to Date must be what was intended to do the job.
Jan 1 '08 #7
vdraceil
236 100+
That's right. The CDate function in that code was simply converting the string to a date value.

I have no idea whether it works or not, but assigning the value to Date must be what was intended to do the job.
So we dont have a possibility of setting time by code in vb6.0 ?!
Jan 3 '08 #8
lotus18
866 512MB
So we dont have a possibility of setting time by code in vb6.0 ?!
Hi

If you want to modify the current system date and time you can try this:

Expand|Select|Wrap|Line Numbers
  1.          Shell "rundll32.exe shell32.dll,Control_RunDLL  timedate.cpl,,0"
  2.  
Rey Sean
Jan 3 '08 #9
vdraceil
236 100+
Hi

If you want to modify the current system date and time you can try this:

Expand|Select|Wrap|Line Numbers
  1.          Shell "rundll32.exe shell32.dll,Control_RunDLL  timedate.cpl,,0"
  2.  
Rey Sean
Where do i give the input time and date?
Jan 3 '08 #10
lotus18
866 512MB
Where do i give the input time and date?
Have you tried the code?

Rey Sean
Jan 3 '08 #11
Killer42
8,435 Expert 8TB
From VB6 Help...
Date Statement

Sets the current system date.

Syntax

Date = date

For systems running Microsoft Windows 95, the required date specification must be a date from January 1, 1980 through December 31, 2099. For systems running Microsoft Windows NT, date must be a date from January 1, 1980 through December 31, 2079.
Jan 4 '08 #12
QVeen72
1,445 Expert 1GB
Isn't CDate() a conversion type function like CInt,CSng etc..Will it set system time?! Please clear my doubt..
hi,

It will change the system date.. why dont you try it..?

Regards
Veena
Jan 4 '08 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Harsha Shah | last post by:
Hello, I have an application that requires specific date format on user's system, so they have to do the setting throgh control panel-> regional setting -> customise -> date -> short format ->...
18
by: Dixie | last post by:
Can I set the Format property in a date/time field in code? Can I set the Input Mask in a date/time field in code? Can I set the Format of a Yes/No field to Checkbox in code? I am working on...
14
by: Jon Davis | last post by:
I have put my users through so much crap with this bug it is an absolute shame. I have a product that reads/writes RSS 2.0 documents, among other things. The RSS 2.0 spec mandates an en-US style...
2
by: Ben | last post by:
I have several pages written in aspx, but sometime the aspx page return the following error. And it hapeen, the whole web application gives this error, that means all the aspx files get affected....
8
by: David Lozzi | last post by:
Howdy, I have a user control that is a report to display data. On the page the control is inserted in, I have filter options to filter the report. When I try to do something like this, nothing...
4
by: Anony Mous | last post by:
Hi, Is there a function that would allow me to set the local time while the server is running? I can't seem to find anything on this... Thanks, Peter ---------------------------(end of...
5
by: Amogh | last post by:
Hi, My question is related to setting freed pointers to NULL. After freeing a pointer: 1) Should the freeing routine also be responsible for setting the pointer to null? 2) Or, should the...
2
by: Bremanand | last post by:
hi... am doing project in vb 6.0 with ms-access... in this i need to tranfer my system date from my dtp to database, for this,i used dtpname.value=now ...
3
by: Carlos Lozano | last post by:
I have requirement to pause the system clock until a certain event (Win XP). Then the clock will be resumed to the real time. I think it can be done using core functions and/or redirecting the...
5
by: adie | last post by:
hi, can anyone help me out with this. the requirement is to display a time (any time) from a distinct timezone (lets say EST) on a webpage but to make available the conversion to the user local...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.