The TimeStamp property has the date and time when the incoming message was sent by the sender. This value is returned in variant format and the date-time format will depend on the datetime format of the computer on which mCore™ is used.
| Usage |
|
| Value Type | Variant |
| Access Mode | Read Only |
| Remarks | Use TimeStampRFC property to get the sending date time in RFC-822 format (e.g. "Mon, 08 Aug 2005 13:30:35 +0530") |
| Visual Basic / ASP (VBScript) |
| Dim objSMS As mCore.SMS, i As Integer Dim Inbox As Inbox, Message As Message Set objSMS = New mCore.SMS ' You can also use Set objSMS = CreateObject("mCore.SMS") ' In case of ASP (VBScript) to create object use ' Set objSMS = Server.CreateObject("mCore.SMS") ' In ASP use Response.Write instead of MsgBox objSMS.Port = "COM2" objSMS.BaudRate = 57600 objSMS.Parity = "N" objSMS.DataBits = 8 objSMS.StopBits = "1" objSMS.MessageMemory = "SM" Set Inbox = objSMS.Inbox Inbox.Concatenate = True Inbox.Refresh If Not objSMS.IsError(True) And Inbox.HasMessages Then MsgBox "Total " & Inbox.Count & " incoming messages!" For Each Message In objSMS.Inbox i = Message.Index MsgBox "Msg Index: " & CStr(i) & vbCrLf & _ Message.TimeStamp & vbCrLf & "From: " _ & Message.Phone & vbCrLf & Message.Text Next ' The following code also generates the same result as above ' Note the various ways of getting each message in the Inbox ' e.g. Inbox(i), Inbox.Message(i) etc. For i = 1 To Inbox.Count MsgBox "Msg Index:" & CStr(i) & vbCrLf & _ objSMS.Inbox.Message(i).TimeStamp & vbCrLf _ & "From: " objSMS.Inbox.Message(i).Phone & _ vbCrLf & objSMS.Inbox.Message(i).Text Next End If ' The following code demonstrates the change in message index ' values after calling the Delete method. You must have more ' than one incoming messages in the modem to understand the ' significance of the following code. MsgBox "Total " & Inbox.Count & " incoming messages!" If Inbox.Count >= 2 Then Inbox.Message(1).Delete MsgBox "Total " & Inbox.Count & " messages in Inbox!" For i = 1 To Inbox.Count MsgBox "Msg Index:" & CStr(i) & vbCrLf & _ Inbox(i).TimeStamp & vbCrLf & "From: " _ & objSMS.Inbox.Message(i).Phone & vbCrLf _ & Inbox.Message(i).Text Next End If Set objSMS = Nothing |