[OpenSIPS-Users] Timestamp in date format

Ben Newlin Ben.Newlin at genesys.com
Mon Feb 22 21:09:29 EST 2021


> I know that there is a get_timestamp function but I need the result to be formatted as date.

You can use the $time variable.
https://www.opensips.org/Documentation/Script-CoreVar-3-1#toc93
$time("%Y-%m-%dT%TZ")

Ben Newlin

From: Users <users-bounces at lists.opensips.org> on behalf of xaled at web.de <xaled at web.de>
Date: Monday, February 22, 2021 at 4:01 PM
To: 'OpenSIPS users mailling list' <users at lists.opensips.org>
Subject: [OpenSIPS-Users] Timestamp in date format
Hi,

I need to create a timestamp node in an XML body like shown below

<timestamp>2013-08-01T12:00:00Z</timestamp>

I know that there is a get_timestamp function but I need the result to be formatted as date.

BTW, is there a way to directly define XML item value using variable

Something like:
$xml(my_doc/doc/list) = "<item>$var(value)</item>";

Unfortunately it does not work like this

Thanks,
Xaled


_______________________________________________
Users mailing list
Users at lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20210222/7eaa9d71/attachment.html>


More information about the Users mailing list