B4J Question Weird Date formatting issue

techknight

Well-Known Member
Licensed User
Longtime User
I am having a problem with the date formatting. This is running in a Raspberry Pi, and I just noticed this issue yesterday. It may be an issue I created, I dont know.

Here is the code that I am using:
B4X:
Private Sub mqtt_MessageArrived (Topic As String, Payload() As Byte)
    Try
        DateTime.DateFormat = "MMM DD"
        DateTime.TimeFormat = "HH:mm:ss"
        Select Case Topic
            Case Settings(4) 'We received a Ping. Send a heartbeat.
                Log(DateTime.Date(DateTime.Now) & " " & DateTime.Time(DateTime.Now) & " RECV: Heartbeat from Host: " & link)
                If mqtt.Connected = True Then mqtt.Publish(Settings(5), "online".GetBytes("UTF-8"))
            Case Settings(3) 'Data packet arrived. Handle it.
                Dim FrameResult() As Int = LoadTeletextData(Payload)
                If FrameResult(0) = 0 Then
                    Log(DateTime.Date(DateTime.Now) & " " & DateTime.Time(DateTime.Now) & " invalid frame received from Host, rejecting")
                Else    
                    PacketTimer.Enabled = False    'Disable the presentation timer, This will prevent the system from trying to overwrite anything else going on which could crash the unit.
                    Log(DateTime.Date(DateTime.Now) & " " & DateTime.Time(DateTime.Now) & " Page " & FrameResult(1)& " Teletext frame received from Host. Caching")
                    BytesToFile("/home/pi/cache", "Page " & FrameResult(1) & ".bin", Payload)
                End If
                            
                'If TestMode = False Then PresentationTimer.Enabled = True
                PacketTimer.Enabled = True
            Case Else
                Log("Message Received over Unsupported Topic")    
                
        End Select
    Catch
        Log(DateTime.Date(DateTime.Now) & " " & DateTime.Time(DateTime.Now) & " Invalid MQTT Message Received from Host")
        Log(LastException)
        Log(LastException.Message)
    End Try
End Sub

Now so far, ive not noticed an issue until yesterday when my console logs shows this:
unknown.png

Last I checked, there arent 56 days in feburary. This is kind of a strange one.

Any ideas?
 
Top