How to change data format?

Kacmil

Новичок
Регистрация
22.12.2016
Сообщения
23
Благодарностей
1
Баллы
3
Hello,
How to change data format from 10 january 2016 to 2016-01-10 ?
I make a template which take DOM that Regex "(?<=<span\ class="articleDate">([\w_]+),).*(?=</span>)"
It change 26 January 2013 (21:20) to 26 January 2013 and I would like to change that to 2013-01-26 and put to variable?
Have you any ideas?
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113

Kacmil

Новичок
Регистрация
22.12.2016
Сообщения
23
Благодарностей
1
Баллы
3
Lokiys thank you very much :-)
I would be very grateful if you help me with regex yet.

DOM:
<span class="articleDate">Sunday, 10 January 2016 (21:20) </span>
Regex:
(?<=<span\ class="articleDate">([\w_]+),) .*(?=</span>)

I have tried in many ways, but I can't delete (21:20) in regex. I would need only "10 January 2016".
(?<=<span\ class="articleDate">([\w_]+),).*(?=\([0-9]{2}:[0-9]{2}\)</span>) <--- This didn't work


Second request:
Your C# code work very good on english months ( January, February etc).
What I have to do to use the month names in other languages (Polish, Russian etc)
 

qzen4i

Client
Регистрация
01.05.2014
Сообщения
1 408
Благодарностей
314
Баллы
83




(?<=,).*(?=\()

what about so? or i don`t understand something?
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)