TimeStampRFC Property

Description:

The TimeStampRFC property has the TimeStamp property in RFC-822 format (e.g. "Mon, 08 Aug 2005 13:30:35 +0530").

   

Usage
  • strTimeStampRFC = ObjectName.Inbox.Message(Index).TimeStampRFC
  • strTimeStampRFC = ObjectName.Inbox(Index).TimeStampRFC
Value Type String
Access Mode Read Only
Remarks Use TimeStamp property to get the sending date time in variant data format for evaluating the date-time using date-time functions. (e.g. To discard incoming messages that were sent more than one hour ago but did not reach because of network congestion)

Usage Example:

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.TimeStampRFC & 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).TimeStampRFC & 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).TimeStampRFC & vbCrLf & "From: " _
           & objSMS.Inbox.Message(i).Phone & vbCrLf _
           & Inbox.Message(i).Text
     Next
End If
Set objSMS = Nothing

  

Copyright © IG Logix Softech Pvt Ltd, All Rights Reserved