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

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.

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.

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.

This was first published in July 2005

Dig deeper on Lotus Notes Domino Agents

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchWinIT

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchVirtualDataCentre.co.uk

Close