Home > Domino Tips > Developer > Verifying user's date setting and time zone on local PC
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

QUICKTIPS

Verifying user's date setting and time zone on local PC


Vishal Sancheti
07.17.2005
Rating: -4.00- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


This code will enforce a unique Date/Time Setting and Time Zone Setting on a user's PC. It will also send alert messages to the Admin Group and user when the date format setting needs to be updated.

Go to Database Script area in Database Resources in the Database. In Database Script "Initialize Event", place the code shown below. Be sure to modify the group names and member names according to your NAB.

Code

Sub Initialize
 Dim session As New NotesSession
 Dim international As NotesInternational
 Dim memo As NotesDocument
 Set international = session.International
 Dim workspace As New NotesUIWorkspace
 Dim uidoc As NotesUIDocument
 Set uidoc = workspace.CurrentDocument
 
 
 Dim sendMess As String, intServerDay As Integer, 
intServerMonth As Integer, intServerYear As Integer, 
strServerNow As String
 sendMess = "AdminGroupName " 
 
 strServerNow = ServerNow()
 intServerDay = Day(ServerNow())
 intServerMonth = Month(ServerNow())
 intServerYear = Year(ServerNow())
 
 If Not international.IsDateDMY Or 
Len(Trim(Mid(Date(),7,4)))<4  
Then
  Msgbox "Please change your date 
format setting to dd/MM/yyyy in ---> 
Control Panel - Regional Settings and 
restart Lotus Notes" ,64,"Date Setting Alert"  
  Set memo = 
session.CurrentDatabase.CreateDocument()
  memo.Form = "Memo"
  memo.SendTo = sendMess
  memo.Subject = "Regional date 
settings of " & session.
CommonUserName & " 's PC is 
not set properly"
  memo.Body = "This is a auto 
message generated on " 
& ServerNow() & " from " 
& session.CommonUserName
  'Call memo.Send(False)
  Call uidoc.Close
  Exit Sub
 End If
 
 If international.TimeZone <> -4 Then
  Msgbox "Please change your 
Time Zone setting to (GMT + 04:00) 
Abu Dhabi, Muscat ---> Control Panel 
- Date Time - Time Zone and 
restart Lotus Notes" ,64,"Time Zone Alert"  
  Set memo = 
session.CurrentDatabase.CreateDocument()
  memo.Form = "Memo"
  memo.SendTo = sendMess
  memo.Subject = "Time Zone settings of  " & 
session.CommonUserName & " 's 
PC is not set properly"
  memo.Body = "This is a auto message 
generated on " 
& ServerNow() & " from  " 
& session.CommonUserName
  'Call memo.Send(False)
  Call uidoc.Close
  Exit Sub
 End If
End Sub

This tip was submitted to the SearchDomino.com tip exchange by member Vishal Sancheti. Please let others know how useful it is via the rating scale below. Do you have a useful Notes/Domino tip or code to share? Submit it to our bimonthly tip contest and you could win a prize and a spot in our Hall of Fame.

Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
Agent
Verify scheduled agent status with Domino Extensible Language (DXL)
How to export data from a Lotus Notes database to a CSV file
Enable or disable scheduled agents without opening the Lotus Notes database design
Creating custom views in Lotus Notes databases
Editing fields in a Lotus Notes view with Ajax
How to automatically create a backup copy of your Domino Directory
Export Lotus Notes documents to Microsoft Word via Internet Explorer
A bevy of Notes/Domino development tips
Best practices for using the Lotus Notes WebQuerySave agent
A flexible data export agent for Lotus Notes

QuickTips
A bevy of Notes/Domino development tips
How to protect your Lotus Notes application design
Merging views
Stop an agent without shutting down the Amgr task
Collapsing outlines
How to make Notes view icons run code
Find all databases associated with a template
Load design for a single database
Options for changing passwords
Importing a CSV file into view

Lotus Notes Domino Agents
Verify scheduled agent status with Domino Extensible Language (DXL)
Top 10 Lotus Notes Domino programming and development tips of 2007
How to export data from a Lotus Notes database to a CSV file
Must-know Lotus Notes Domino agents -- 10 tips in 10 minutes
Enable or disable scheduled agents without opening the Lotus Notes database design
Creating custom views in Lotus Notes databases
Editing fields in a Lotus Notes view with Ajax
Troubleshooting a scheduled agent not running on a Global Notes Architecture (GNA) server
Can I stop Lotus Domino Server from transforming embedded images into attachments?
How to automatically create a backup copy of your Domino Directory

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.

HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 1999 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts