Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

118
Views
how to set time to xmpp stanzas object

i have a xmpp server, then i have function to send message via xmpp and i use npm (@xmpp/client) for nodejs

 var message = 'test';
      const stanzas = xml("message", {
            to: receiver,
            type: "notification",
            time: time.datetime()* //not work
            
        }, xml("body", null, message),
           xml("time", "urn:xmpp:time")) // not work
        await xmpp.send(stanzas).catch(console.error);

*(2022-06-02T13:39:31Z)

This function works and send correct
The problem is that i cant set timeStamp for this
I just try to send time in main object of message, send in xml - no success

my result stanzas is:

 Element {
   name: 'message',
   parent:
    Element {
      name: 'stream:stream',
      parent: null,
      children: [],
      attrs:
       { version: '1.0',
         xmlns: 'jabber:client',
         'xmlns:stream': 'http://etherx.jabber.org/streams',
         to: 'localhost',
         'xml:lang': undefined } },
   children:
    [ Element { name: 'body', parent: [Circular], children: [Array], attrs: {} },
      Element {
        name: 'time',
        parent: [Circular],
        children: [],
        attrs: [Object] } ],
   attrs:
    { to: 'testJabber',
      type: 'notification',
      time: '2022-06-02T13:39:31Z' } }

What i get as a function success result:

()testServer : test  

What i should get:

(02.06.2022 13:39:31)testServer : test
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!